Why does every Microsoft AutoGen install guide still tell you pip install pyautogen – and then your first from autogen_agentchat.agents import AssistantAgent blows up?
You’re not imagining it. As of python-v0.7.5 (PyPI packages dated 30 Sep 2025), the stack you want lives under split names on microsoft/autogen. Wrong PyPI name → AG2 or legacy 0.2 APIs. Same machine, same import muscle memory, totally different product. This guide is deploy-only: pins, extras, cleanup, verify.
What you’re deploying (and what you’re not)
Microsoft AutoGen here means Core + AgentChat + Extensions. Per the README caution banner, the project is in maintenance mode – bug and security fixes, no feature train – and new greenfield work is steered to Microsoft Agent Framework. Still need 0.7.5 for labs, locked deps, or Studio prototypes? Install it on purpose.
AG2 is pip install ag2 (separate project). Classic pyautogen / bare autogen are the names broken tutorials keep recycling.
Think of the old one-liner like grabbing a USB cable that fits the port but talks a different protocol. Everything “installs.” Nothing matches the AgentChat docs.
System requirements for Microsoft AutoGen 0.7.5
Official docs hard-require the interpreter. The rest is what you actually need to run agents without fighting the host.
| Item | Requirement |
|---|---|
| Python | 3.10 or later (as of AgentChat install docs) |
| Environment | venv or conda – avoid global site-packages |
| Network | Outbound HTTPS to your model API |
| Model access | Provider key (e.g. OpenAI via OPENAI_API_KEY) |
| Optional | Docker Engine for DockerCommandLineCodeExecutor; Node/npm only if you run MCP servers such as Playwright |
Local Ollama only after the matching autogen-ext extra. Conda users often copy the docs’ python=3.12 env example – fine, still 3.10+.
Official download source
Skip random wheels.
- Source / tag
python-v0.7.5: github.com/microsoft/autogen - PyPI:
autogen-agentchat,autogen-core,autogen-ext, optionalautogenstudio - Docs: microsoft.github.io/autogen/stable
Pip wheels unless you are patching the framework.
Step-by-step install (pinned 0.7.5)
Clean env first. Global site-packages is how the wrong autogen name sneaks in.
# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
# Windows (cmd)
python -m venv .venv
.venvScriptsactivate.bat
# Or conda (docs examples often use 3.12)
conda create -n autogen python=3.12
conda activate autogen
If this machine ever followed an old tutorial, purge the colliding names:
pip uninstall -y autogen pyautogen ag2 ag2-classic autogen-agentchat autogen-core autogen-ext autogenstudio 2>/dev/null
pip install -U pip
README + installation guide line, pinned:
pip install -U "autogen-agentchat==0.7.5" "autogen-ext[openai]==0.7.5"
Azure, Docker code exec, Ollama, Anthropic, MCP client bits – stack extras on one wheel (metadata on PyPI autogen-ext):
pip install -U "autogen-ext[openai,azure,docker,ollama,anthropic,mcp]==0.7.5"
Optional GUI:
pip install -U "autogenstudio"
Pro tip: Keep
autogen-core,autogen-agentchat, andautogen-exton the same 0.7.5. Ext declaresautogen-core==0.7.5; Studio or an old requirements file pulling 0.5.x beside 0.7.x is a silent import/config foot-gun.
First-time configuration
Bare minimum: API key in the environment. Not hard-coded in scripts.
# Linux / macOS
export OPENAI_API_KEY="sk-..."
# Windows PowerShell
$env:OPENAI_API_KEY="sk-..."
Azure OpenAI wants endpoint, deployment name, and API version on the client (and autogen-ext[azure] if you use AAD). Docker-backed code execution: Engine/Desktop up, docker info clean, [docker] extra present so DockerCommandLineCodeExecutor imports. Docs default image is python:3-slim.
Verify the install works
Version check – expect three 0.7.5 lines:
python -c "import autogen_agentchat, autogen_core, autogen_ext; import importlib.metadata as m; print('agentchat', m.version('autogen-agentchat')); print('core', m.version('autogen-core')); print('ext', m.version('autogen-ext'))"
Smoke-test AgentChat (needs key + network):
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def main() -> None:
model_client = OpenAIChatCompletionClient(model="gpt-4o")
agent = AssistantAgent("assistant", model_client=model_client)
print(await agent.run(task="Say 'Hello World!'"))
await model_client.close()
asyncio.run(main())
Studio (if installed):
autogenstudio ui --port 8080 --appdir ./my-app
# open http://localhost:8080
Common install errors and fixes
- Wrong package / old API –
from autogen import ...“works” but docs samples usingautogen_agentchatfail, or you landed on AG2. Uninstallautogen/pyautogen/ag2, new venv, onlyautogen-agentchat+autogen-ext[...]. Turns out this is the failure mode showing up over and over on SO/GitHub. - ModuleNotFoundError: autogen_ext… (e.g.
OpenAIChatCompletionClient) – agentchat without the extension extra.pip install "autogen-ext[openai]==0.7.5". - DockerCommandLineCodeExecutor missing dependencies – install
autogen-ext[docker], confirmdocker info. Without the daemon you get import failure or a push toward local execution. - Mixed minors across core / agentchat / ext – pin all three to 0.7.5; release tag ships them in lockstep as
python-v0.7.5. - MCP Playwright quickstart hangs / opaque connection errors – install the npm side first:
npm install -g @playwright/mcp@latest(or the sample’snpxpath) before the Python agent dials that server. - langchain / pydantic fights – leftover globals. Fresh venv; don’t drag ancient LangChain pins into the same env.
Upgrade and uninstall
The catch is there is no shiny next AutoGen feature release to chase. Stay pinned or migrate.
# Stay on the last Microsoft AutoGen line
pip install -U "autogen-agentchat==0.7.5" "autogen-ext[openai]==0.7.5"
# From 0.2-era APIs: rewrite imports (AssistantAgent under autogen_agentchat,
# model clients under autogen_ext) using the AgentChat migration notes on the docs site.
# Full cleanup
pip uninstall -y autogen-agentchat autogen-core autogen-ext autogenstudio
# Studio may have created ~/.autogenstudio or your --appdir - remove if you want a blank slate
rm -rf .venv
New production path from Microsoft: pip install agent-framework and the official AutoGen → Agent Framework migration guide.
Smoke test printed a model reply? You’re done installing. Drop the pins in requirements.txt before the next machine “helps” by resolving floating versions.
FAQ
Is Microsoft AutoGen still okay to install in 2026?
For existing apps and learning AgentChat APIs, yes. As a long-term greenfield bet, no – maintenance mode, successor is Agent Framework.
What’s the difference between autogen-agentchat, autogen-ext, and autogenstudio?
Hello World only: autogen-agentchat is agents/teams, autogen-core comes along as the runtime dependency, autogen-ext[openai] is what actually exports OpenAIChatCompletionClient. Studio is a separate drag-and-drop UI package – handy for prototypes, not your production host.
Can I install from source or only use Docker?
Source (pip install -e in the monorepo) is for contributors. Deployers should stay on PyPI wheels. Docker is not how you install AutoGen; it’s an optional sandbox for model-generated code via DockerCommandLineCodeExecutor after autogen-ext[docker]. Baking the whole app into a container is fine – same pip pins in the image, secrets mounted or injected, never baked as sk-... layers.