{"record":{"id":"b019943d9371a9bf","repo":"microsoft/autogen","slug":"missing-dependecies-for-dockercommandlinecodeexecu","errorCode":null,"errorMessage":"Missing dependecies for DockerCommandLineCodeExecutor. Please ensure the autogen-ext package was installed with the 'docker' extra.","messagePattern":"Missing dependecies for DockerCommandLineCodeExecutor\\. Please ensure the autogen-ext package was installed with the 'docker' extra\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/code_executors/docker/_docker_code_executor.py","lineNumber":49,"sourceCode":"    CommandLineCodeResult,\n    build_python_functions_file,\n    get_file_name_from_content,\n    lang_to_cmd,\n    silence_pip,\n)\n\nif sys.version_info >= (3, 11):\n    from typing import Self\nelse:\n    from typing_extensions import Self\n\ntry:\n    import asyncio_atexit\n    import docker\n    from docker.errors import DockerException, ImageNotFound, NotFound\n    from docker.models.containers import Container\nexcept ImportError as e:\n    raise RuntimeError(\n        \"Missing dependecies for DockerCommandLineCodeExecutor. Please ensure the autogen-ext package was installed with the 'docker' extra.\"\n    ) from e\n\n\nasync def _wait_for_ready(container: Any, timeout: int = 60, stop_time: float = 0.1) -> None:\n    elapsed_time = 0.0\n    while container.status != \"running\" and elapsed_time < timeout:\n        await asyncio.sleep(stop_time)\n        elapsed_time += stop_time\n        await asyncio.to_thread(container.reload)\n        continue\n    if container.status != \"running\":\n        raise ValueError(\"Container failed to start\")\n\n\nA = ParamSpec(\"A\")\n\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/code_executors/docker/_docker_code_executor.py#L31-L67","documentation":"Raised at import time of autogen_ext.code_executors.docker when the optional `docker` and `asyncio_atexit` dependencies are missing. The module cannot even be imported without them, so the error appears on `from ... import DockerCommandLineCodeExecutor`, before any code runs.","triggerScenarios":"Importing DockerCommandLineCodeExecutor (or the config/model modules that pull it in, e.g. via autogen-ext's code_executor backends) in an environment where `pip install autogen-ext` was done without the [docker] extra and the docker/asyncio_atexit packages are absent.","commonSituations":"Fresh environments where autogen-ext was installed plain or with a different extra (e.g. [websockets]); CI images that strip optional deps; installing from a requirements.txt that lists autogen-ext without extras.","solutions":["Install the extra: pip install \"autogen-ext[docker]\"","Add the extra to requirements.txt/pyproject: autogen-ext[docker]>=<version>","Verify with: python -c \"import docker, asyncio_atexit\" and that the Docker CLI works","Note the typo 'dependecies' in the message is upstream; match on the class name or 'docker' extra when grepping logs"],"exampleFix":"# before: pip install autogen-ext\n# after:  pip install 'autogen-ext[docker]'","handlingStrategy":"validation","validationCode":"# probe before importing the executor\ndef docker_extra_available() -> bool:\n    try:\n        import docker  # noqa\n        import asyncio_atexit  # noqa\n        return True\n    except ImportError:\n        return False\n\nif not docker_extra_available():\n    raise SystemExit(\"pip install 'autogen-ext[docker]' before using the Docker executor\")","typeGuard":"null","tryCatchPattern":"try:\n    from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor\nexcept RuntimeError as e:\n    if \"docker\" in str(e):\n        subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"autogen-ext[docker]\"])\n        from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor","preventionTips":["Pin extras in dependency files: autogen-ext[docker]==<version>","Docker executors are optional-dependency gated; smoke-test the import in CI for every environment that uses them"],"tags":["docker","dependencies","installation","import-error"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}