Creating Python Environments
Wing can create a number of different kinds of Python environments along with your project: virtualenvs, Poetry envs, uv envs, pipenvs, Anaconda envs, or Docker containers. These are selected in the Python section of the New Project dialog, by setting Environment to New Env and selecting the kind with Manager. Docker is offered only in All Options. Wing presents different configuration options for each type of environment, as detailed below. Simple leaves out some of them. See Creating a Project for details.
Creating a Virtualenv
By default the new virtualenv is created as .venv inside the new or existing source directory chosen in the New Project dialog. To put it elsewhere, click All Options and change its Name and Parent Directory.
The Python Executable is used to select the base Python installation to use with the new virtualenv. This determines the Python version that will be used. Choose one of the Pythons Wing found, newest first, or Other: to enter or browse to another.
You can use Packages to Install to select any packages you want to install while creating the new environment. This may be done by entering the package specifications under Package Names, or choosing a Package File: an existing requirements.txt, Pipfile, Anaconda environment.yml, or pyproject.toml.
Selecting Upgrade pip causes Wing to upgrade pip, the Python package manager, after setting up the virtualenv. This is recommended since virtualenv usually installs an outdated version of pip.
Checking Inherit global site-packages can be used to allow the virtualenv access to packages that have been installed into the selected base Python installation. This is not recommended because it may defeat the primary purpose of virtualenvs, to provide a uniform replicable environment.
When a new virtualenv environment is created, Wing writes a requirements.txt file for package management into the selected source directory. In Wing, subsequent package installation, removal, upgrade, and inspection is possible through the Packages tool, which will maintain the requirements.txt file on request.
Creating Poetry, uv, and pipenv Environments
Poetry, uv, and pipenv are tools that automate and simplify maintenance of a virtualenv and package management in that environment, with focus on the ease of replication of identical package environments for developers working on the same source base. They can be used to create and manage a new virtualenv for either an existing or newly created source directory. Since Poetry, uv, and pipenv manage the virtualenv automatically, there is no option to select the location for the new virtualenv.
The Python Executable and any Packages to Install may be entered as described for virtualenv above.
If the chosen tool is not installed, the dialog says so as soon as it is chosen. Wing can install it for your user account with pip install --user, or for uv also with pipx install uv. Press Install Now to install it right away; when there is more than one way to install it, Wing asks which to use. If it is still missing when you press Create Project, Wing asks before installing it, and then installs it as one of the steps of creating the project. When the selected Python Executable has no pip, choose another one.
When Poetry creates a new environment, it will write pyproject.toml if not already present and also the poetry.lock file into the selected source directory. These files are used by Poetry to manage package installation, dependencies, and upgrades.
Similarly, uv creates pyproject.toml and uv.lock, and pipenv creates Pipfile and Pipfile.lock in the selected source directory.
See Using Wing with Poetry, Using Wing with uv, and Using Wing with pipenv for details.
Creating an Anaconda Environment
Anaconda is a Python distribution that provides its own package manager.
Somewhat like Poetry, uv, and pipenv, the conda package manager can store its environments in a hidden centrally managed location, allowing reference to them by name. To store the environment elsewhere, set the Parent Directory to Selected Directory and enter the full path of the parent directory for the new environment.
Anaconda Installation is used to select the Anaconda base installation to use in creating the new environment. If none is found, the dialog links to the Miniconda installer. Once it is installed, select its directory as the Anaconda Installation.
Packages to Install selects any packages to install in the new environment, as described for virtualenv above.
The new project activates the environment with the installation's activate, by name when it is in the installation's envs directory and by its full path otherwise.
Creating a Docker Environment
There are two options for creating a new Docker environment along with your new project: (1) You may use an existing already-created Docker container as your Python environment, or (2) you may create a new Docker container along with your project and configure Wing to use it. The former only creates a container configuration that allows Wing to access the Docker container, while the latter also creates a new Docker container.
These options are described in detail in Using Wing with Docker.
How Projects Run Each Kind of Environment
The table lists how New Env and Existing Env in the New Project dialog set Python Executable in Project Properties for each kind of environment, and what activates the environment each time Wing runs Python. New Env creates only virtualenvs, uv, Poetry, and pipenv environments, Anaconda environments, and Docker containers. The other kinds are used with Existing Env.
| Environment | Python Executable | Activated By | Notes |
| Virtualenv, venv, uv, Poetry, or pipenv | Activated Env with the environment's bin/activate, or Scripts\activate.bat on Windows | The environment's activate script | A uv environment has no pip, so the Packages tool uses uv pip |
| Virtualenv moved or copied from where it was created | Command Line with the environment's Python, with a notice | Wing, from the environment's own directory | The environment's scripts may still run the original environment's Python |
| Anaconda environment | Activated Env with the Anaconda installation's activate and the environment's name or path | Anaconda's activate, which runs the environment's activation scripts | -- |
| Anaconda base installation | Activated Env with the installation's activate | Anaconda's activate | -- |
| pixi environment | Command Line with pixi run --frozen | pixi, which also applies the pixi project's activation settings | --frozen keeps a launch from changing pixi.lock. Local host only. |
| micromamba environment | Command Line with micromamba run -p, except on Windows | micromamba, which runs the environment's activation scripts | On Windows, Activated Env with an installed Anaconda's activate |
A moved or copied virtualenv's activate script would activate the original environment, so Wing runs its Python directly and sets up the environment itself. Creating the environment again fixes its scripts. An environment made with uv venv --relocatable activates correctly from anywhere, so Wing uses its activate script.
When pixi or micromamba is not found, Wing activates the environment with the activate of any Anaconda installation it finds. On Windows, Wing never uses micromamba run, since it changes arguments that contain % or &. When there is no Anaconda installation either, Wing runs the environment's Python without activating it, and the dialog shows a notice that says how to fix this.
When Python Executable is set to Command Line with the Python of a virtualenv or an Anaconda environment, Wing also activates the environment each time it runs Python. This is done from the environment's own directory, so it works for a moved virtualenv too. As a result, Existing Python and Existing Env run these environments in the same way. A micromamba or pixi environment's Python is activated this way only through an Anaconda installation that Wing finds.
Start Terminal in the OS Commands tool's menu activates the environment in the same way, except for pixi and micromamba environments run through pixi run or micromamba run.
