microsoft/autogen · error · ImportError
Dependencies for Llama Cpp not found. Please install llama-c
Error message
Dependencies for Llama Cpp not found. Please install llama-cpp-python: pip install autogen-ext[llama-cpp]
What it means
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]'.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/models/llama_cpp/__init__.py:4
try:
from ._llama_cpp_completion_client import LlamaCppChatCompletionClient
except ImportError as e:
raise ImportError(
"Dependencies for Llama Cpp not found. "
"Please install llama-cpp-python: "
"pip install autogen-ext[llama-cpp]"
) from e
__all__ = ["LlamaCppChatCompletionClient"]
View on GitHub (pinned to 027ecf0a37)
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"
Example fix
# before pip install autogen-ext python -c "import autogen_ext.models.llama_cpp" # ImportError # after pip install "autogen-ext[llama-cpp]" python -c "import autogen_ext.models.llama_cpp" # ok
Defensive patterns
Strategy: try-catch
Validate before calling
try:
import llama_cpp # noqa: F401
except ImportError:
raise SystemExit("Run: pip install 'autogen-ext[llama-cpp]'")
from autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient Try / catch
try:
from autogen_ext.models.llama_cpp import LlamaCppChatCompletionClient
except ImportError as e:
if "llama-cpp" in str(e):
LlamaCppChatCompletionClient = None # feature-flag local-llm support
else:
raise Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Dependencies for AzureAIAgent not found. Please install auto
- Dependencies for MagenticOneCoderAgent not found. Please ins
- Missing dependecies for DockerCommandLineCodeExecutor. Pleas
- Invalid name: {name}. Only letters, numbers, '_' and '-' are
- Invalid name: {name}. Name must be less than 64 characters.
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/327eceb4653c617b.
Report an issue: GitHub.