{"record":{"id":"f44b51ccc3f0892f","repo":"microsoft/autogen","slug":"dependencies-for-azureaiagent-not-found-please-in","errorCode":null,"errorMessage":"Dependencies for AzureAIAgent not found. Please install autogen-ext with the \"azure\" extra: pip install \"autogen-ext[azure]\"","messagePattern":"Dependencies for AzureAIAgent not found\\. Please install autogen-ext with the \"azure\" extra: pip install \"autogen-ext\\[azure\\]\"","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/agents/azure/__init__.py","lineNumber":4,"sourceCode":"try:\n    from ._azure_ai_agent import AzureAIAgent\nexcept ImportError as e:\n    raise ImportError(\n        \"Dependencies for AzureAIAgent not found. \"\n        'Please install autogen-ext with the \"azure\" extra: '\n        'pip install \"autogen-ext[azure]\"'\n    ) from e\n\n__all__ = [\"AzureAIAgent\"]\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/agents/azure/__init__.py#L1-L11","documentation":"ImportError raised at import time of autogen_ext.agents.azure when the optional Azure AI Projects SDK dependencies are missing. autogen-ext ships extras; the 'azure' extra installs the azure-ai-projects / azure-identity packages that _azure_ai_agent.py imports. The original ImportError is chained (from e), so the real missing module appears in the traceback cause.","triggerScenarios":"`from autogen_ext.agents.azure import AzureAIAgent` (or any import path touching autogen_ext.agents.azure) in an environment where autogen-ext was installed without the [azure] extra.","commonSituations":"Fresh venv with plain `pip install autogen-ext`; CI caches that prune extras; dependency resolvers/downgraders that reinstall autogen-ext without extras; mixing conda and pip installs.","solutions":["Install the extra: pip install \"autogen-ext[azure]\"","Pin it in requirements.txt/pyproject: autogen-ext[azure]>=<version> so CI and teammates get it.","Verify with python -c \"import azure.ai.projects\" — if that fails, the underlying SDK is what's missing.","If it still fails after install, check the chained ImportError cause for a conflicting/broken azure package version and reinstall it."],"exampleFix":"# before\npip install autogen-ext\n# after\npip install \"autogen-ext[azure]\"","handlingStrategy":"validation","validationCode":"def azure_extra_available() -> bool:\n    try:\n        import azure.ai.projects  # noqa\n        return True\n    except ImportError:\n        return False\n\nif not azure_extra_available():\n    raise SystemExit('Run: pip install \"autogen-ext[azure]\"')","typeGuard":null,"tryCatchPattern":"try:\n    from autogen_ext.agents.azure import AzureAIAgent\nexcept ImportError as e:\n    print(e)  # includes the pip install \"autogen-ext[azure]\" hint\n    raise SystemExit(1)","preventionTips":["Declare autogen-ext extras in pyproject/requirements, not just the base package.","Pin versions so dependency resolvers can't silently drop extras.","Add a smoke-test import in CI for every optional extra you use."],"tags":["installation","dependencies","azure","autogen-ext"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}