microsoft/vscode-python-environments
TypeScript
Captured source
source ↗microsoft/vscode-python-environments
Description: VS Code extension for Python environment and package management
Language: TypeScript
License: MIT
Stars: 131
Forks: 46
Open issues: 115
Created: 2024-10-17T16:21:36Z
Pushed: 2026-06-11T00:46:18Z
Default branch: main
Fork: no
Archived: no
README:
Python Environments (preview)
> Note: The Python Environments icon may no longer appear in the Activity Bar due to the ongoing rollout of the Python Environments extension. To restore the extension, add "python.useEnvironmentsExtension": true to your User settings. This setting is temporarily necessary until the rollout is complete!
Overview
The Python Environments extension for VS Code helps you manage Python environments and packages using your preferred environment manager, backed by its extensible APIs. This extension provides unique support for specifying environments for specific files, entire Python folders, or projects, including multi-root and mono-repo scenarios. The core feature set includes:
- 🌐 Create, delete, and manage environments
- 📦 Install and uninstall packages within the selected environment
- ✅ Create activated terminals
- 🖌️ Add and create new Python projects
> Note: This extension is in preview, and its APIs and features are subject to change as the project evolves.
> Important: This extension requires version 2024.23, or later, of the Python extension (ms-python.python).
Features
The "Python Projects" fold shows you all of the projects that are currently in your workspace and their selected environments. From this view you can add more files or folders as projects, select a new environment for your project, and manage your selected environments.
The "Environment Managers" fold shows you all of the environment managers that are available on your machine with all related environments nested below. From this view, you can create new environments, delete old environments, and manage packages.
Environment Management
The Python Environments panel provides an interface to create, delete and manage environments.
To simplify the environment creation process, you can use "Quick Create" to automatically create a new virtual environment using:
- Your default environment manager (e.g.,
venv) - The latest Python version
- Workspace dependencies
For more control, you can create a custom environment where you can specify Python version, environment name, packages to be installed, and more!
The following environment managers are supported out of the box:
| Id | Name | Description | | ----------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ms-python.python:venv | venv | Built-in environment manager provided by the Python standard library. Supports creating environments (interactive and quick create) and finding existing environments. | | ms-python.python:system | System Installed Python | Global Python installs on your system, typically installed with your OS, from python.org, or any other OS package manager. | | ms-python.python:conda | conda | The conda environment manager, as provided by conda distributions like Anaconda Distribution or conda-forge. Supports creating environments (interactive and quick create) and finding existing environments. | | ms-python.python:pyenv | pyenv | The pyenv environment manager, used to manage multiple Python versions. Supports finding existing environments. | | ms-python.python:poetry | poetry | The poetry environment manager, used for dependency management and packaging in Python projects. Supports finding existing environments. | | ms-python.python:pipenv | pipenv | The pipenv environment manager, used for managing Python dependencies and environments. Only supports finding existing environments. |
Supported Actions by Environment Manager
| Environment Manager | Find Environments | Create | Quick Create | | ------------------- | ----------------- | ------ | ------------ | | venv | ✅ | ✅ | ✅ | | conda | ✅ | ✅ | ✅ | | pyenv | ✅ | | | | poetry | ✅ | | | | system | ✅ | | | | pipenv | ✅ | | |
Legend:
- Create: Ability to create new environments interactively.
- Quick Create: Ability to create environments with minimal user input.
- Find Environments: Ability to discover and list existing environments.
Environment managers are responsible for specifying which package manager will be used by default to install and manage Python packages within the environment (venv uses pip by default). This ensures that packages are managed consistently according to the preferred tools and settings of the chosen environment manager.
Package Management
The extension also provides an interface to install and uninstall Python packages, and provides APIs for extension developers to contribute package managers of their choice.
The extension uses pip as the default package manager, but you can use the package manager of your choice using the python-envs.defaultPackageManager setting. The following are package managers supported out of the box:
| Id | Name | Description | | ---------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ms-python.python:pip | pip | Pip acts as the default package manager and it's typically built-in to Python. | | ms-python.python:conda | conda | The conda package manager, as provided by conda distributions like Anaconda Distribution or conda-forge. |
Default Package Manager by Environment Manager
| Environment Manager | Default Package Manager | | ------------------- | ----------------------- | | venv | pip | | conda | conda | | pyenv | pip | | poetry | poetry | | system | pip | | pipenv | pip |
Project Management
A…
Excerpt shown — open the source for the full document.
Notability
notability 3.0/10Routine repo fork, low traction