Python environments in VS Code
The Python Environments extension brings environment and package management into Visual Studio Code's UI. The extension provides a unified interface for creating environments, installing packages, and switching interpreters, regardless whether you're using venv, uv, conda, pyenv, poetry, or pipenv.
Core features:
- Creating, deleting, and switching between environments
- Installing and managing packages
- Activated Python in terminals
- Assigning environments to specific files or folders (called "Python projects")
The extension works alongside the Python extension and requires no setup to get started.
Quick start
Most users don't need to configure anything. The extension automatically discovers your Python environments and uses them when running code.
If you have a basic setup, such as one environment for your whole workspace:
- Open a Python file
- Check the Status Bar to see which environment is active
- To switch environments, select the environment control in the Status Bar
Need to create an environment? Open the Python sidebar, expand Environment Managers, and select the + button. The extension walks you through the different steps.
User interface components
Environment discovery
The following environment managers are discovered automatically:
| Manager | Search locations |
|---|---|
| venv | Workspace folders (configurable via workspaceSearchPaths) |
| System Python | PATH, /usr/bin, /usr/local/bin, Windows Registry, python.org installs |
| Conda | Runs conda info --envs to find configured environment directories |
| Pyenv | $PYENV_ROOT/versions or ~/.pyenv/versions |
| Poetry | Project .venv folders and ~/.cache/pypoetry/virtualenvs |