{"record":{"id":"327eceb4653c617b","repo":"microsoft/autogen","slug":"dependencies-for-llama-cpp-not-found-please-insta","errorCode":null,"errorMessage":"Dependencies for Llama Cpp not found. Please install llama-cpp-python: pip install autogen-ext[llama-cpp]","messagePattern":"Dependencies for Llama Cpp not found\\. Please install llama-cpp-python: pip install autogen-ext\\[llama-cpp\\]","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/llama_cpp/__init__.py","lineNumber":4,"sourceCode":"try:\n    from ._llama_cpp_completion_client import LlamaCppChatCompletionClient\nexcept ImportError as e:\n    raise ImportError(\n        \"Dependencies for Llama Cpp not found. \"\n        \"Please install llama-cpp-python: \"\n        \"pip install autogen-ext[llama-cpp]\"\n    ) from e\n\n__all__ = [\"LlamaCppChatCompletionClient\"]\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/llama_cpp/__init__.py#L1-L11","documentation":"ImportError raised at package import time by autogen_ext.models.llama_cpp.__init__ when the underlying import of LlamaCppChatCompletionClient fails — i.e. the optional llama-cpp-python dependency is not installed. The exception chain (from e) preserves the original ImportError; the message tells you to install the extra via 'pip install autogen-ext[llama-cpp]'.","triggerScenarios":"import autogen_ext.models.llama_cpp (or any module importing it, e.g. LlamaCppChatCompletionClient references in configs) on an environment where the base autogen-ext package was installed without the [llama-cpp] extra; broken llama-cpp-python build (it compiles C++ and can fail to import even when pip-listed).","commonSituations":"requirements.txt lists only 'autogen-ext'; fresh venv/CI image without the extra; llama-cpp-python installed for a different Python or failed to compile against the local toolchain, leaving an importable-looking but broken install.","solutions":["pip install \"autogen-ext[llama-cpp]\" in the same environment/interpreter you run","If llama-cpp-python itself fails to build, install a prebuilt wheel matching your Python/ platform (e.g. pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu) then reinstall the extra","Verify with: python -c \"import llama_cpp; import autogen_ext.models.llama_cpp\""],"exampleFix":"# before\npip install autogen-ext\npython -c \"import autogen_ext.models.llama_cpp\"  # ImportError\n\n# after\npip install \"autogen-ext[llama-cpp]\"\npython -c \"import autogen_ext.models.llama_cpp\"  # ok","handlingStrategy":"try-catch","validationCode":"try:\n    import llama_cpp  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"Run: pip install 'autogen-ext[llama-cpp]'\")\n\nfrom autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient","typeGuard":null,"tryCatchPattern":"try:\n    from autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient\nexcept ImportError as e:\n    if \"llama-cpp\" in str(e):\n        LlamaCppChatCompletionClient = None  # feature-flag local-llm support\n    else:\n        raise","preventionTips":["Declare 'autogen-ext[llama-cpp]' in requirements for any llama.cpp feature","Smoke-test `import llama_cpp` in CI for the exact interpreter","Use prebuilt llama-cpp-python wheels to avoid local C++ build failures"],"tags":["llama-cpp","optional-dependency","importerror","installation"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}