When installing AutoGen locally, we recommend using a virtual environment for the installation. This will ensure that the dependencies for AutoGen are isolated from the rest of your system.
<Tabs>
<TabItem value="venv" label="venv" default>
Create and activate:
```bash
python3 -m venv pyautogen
source pyautogen/bin/activate
```
To deactivate later, run:
```bash
deactivate
```
</TabItem>
<TabItem value="conda" label="Conda">
[Install Conda](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html) if you have not already.
Create and activate:
```bash
conda create -n pyautogen python=3.10
conda activate pyautogen
```
To deactivate later, run:
```bash
conda deactivate
```
</TabItem>
<TabItem value="poetry" label="Poetry">
[Install Poetry](https://python-poetry.org/docs/#installation) if you have not already.
Create and activate:
```bash
poetry init
poetry shell
poetry add pyautogen
```
To deactivate later, run:
```bash
exit
```
</TabItem>
</Tabs>
## Install AutoGen
AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:
```bash
pip install pyautogen
```
:::info
`pyautogen<0.2` required `openai<1`. Starting from pyautogen v0.2, `openai>=1` is required.
The default behaviour for code-execution agents is for code execution to be performed in a docker container.
**To turn this off**: if you want to run the code locally (not recommended) then `use_docker` can be set to `False` in `code_execution_config` for each code-execution agent, or set `AUTOGEN_USE_DOCKER` to `False` as an environment variable.
You might want to override the default docker image used for code execution. To do that set `use_docker` key of `code_execution_config` property to the name of the image. E.g.: