You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 23, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+37-34Lines changed: 37 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Python Environments (preview)
2
-
> **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!
2
+
3
+
> **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!
3
4
4
5
## Overview
5
6
@@ -38,30 +39,31 @@ For more control, you can create a custom environment where you can specify Pyth
38
39
39
40
The following environment managers are supported out of the box:
| 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. |
44
-
| ms-python.python:system| System Installed Python | Global Python installs on your system, typically installed with your OS, from [python.org](https://www.python.org/), or any other OS package manager. |
| 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. |
45
+
| ms-python.python:system| System Installed Python | Global Python installs on your system, typically installed with your OS, from [python.org](https://www.python.org/), or any other OS package manager. |
45
46
| ms-python.python:conda|`conda`| The [conda](https://conda.org) environment manager, as provided by conda distributions like [Anaconda Distribution](https://docs.anaconda.com/anaconda/) or [conda-forge](https://conda-forge.org/download/). Supports creating environments (interactive and quick create) and finding existing environments. |
46
-
| ms-python.python:pyenv|`pyenv`| The [pyenv](https://github.com/pyenv/pyenv) environment manager, used to manage multiple Python versions. Supports finding existing environments. |
47
-
| ms-python.python:poetry|`poetry`| The [poetry](https://python-poetry.org/) environment manager, used for dependency management and packaging in Python projects. Supports finding existing environments. |
48
-
| ms-python.python:pipenv|`pipenv`| The [pipenv](https://pipenv.pypa.io/en/latest/) environment manager, used for managing Python dependencies and environments. Only supports finding existing environments. |
47
+
| ms-python.python:pyenv|`pyenv`| The [pyenv](https://github.com/pyenv/pyenv) environment manager, used to manage multiple Python versions. Supports finding existing environments. |
48
+
| ms-python.python:poetry|`poetry`| The [poetry](https://python-poetry.org/) environment manager, used for dependency management and packaging in Python projects. Supports finding existing environments. |
49
+
| ms-python.python:pipenv|`pipenv`| The [pipenv](https://pipenv.pypa.io/en/latest/) environment manager, used for managing Python dependencies and environments. Only supports finding existing environments. |
-**Create**: Ability to create new environments interactively.
63
-
-**Quick Create**: Ability to create environments with minimal user input.
64
-
-**Find Environments**: Ability to discover and list existing environments.
63
+
64
+
-**Create**: Ability to create new environments interactively.
65
+
-**Quick Create**: Ability to create environments with minimal user input.
66
+
-**Find Environments**: Ability to discover and list existing environments.
65
67
66
68
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.
67
69
@@ -79,13 +81,13 @@ The extension uses `pip` as the default package manager, but you can use the pac
79
81
#### Default Package Manager by Environment Manager
80
82
81
83
| Environment Manager | Default Package Manager |
82
-
|---------------------|------------------------|
83
-
| venv | pip |
84
-
| conda | conda |
85
-
| pyenv | pip |
86
-
| poetry | poetry |
87
-
| system | pip |
88
-
| pipenv | pip |
84
+
|-------------------|-----------------------|
85
+
| venv | pip |
86
+
| conda | conda |
87
+
| pyenv | pip |
88
+
| poetry | poetry |
89
+
| system | pip |
90
+
| pipenv | pip |
89
91
90
92
### Project Management
91
93
@@ -99,26 +101,27 @@ There are a few ways to add a Python Project from the Python Environments panel:
| Add Existing | Allows you to add an existing folder from the file explorer. |
101
103
| Auto find | Searches for folders that contain `pyproject.toml` or `setup.py` files |
102
-
| Create New | Creates a new project from a template. |
104
+
| Create New | Creates a new project from a template. |
105
+
106
+
#### Create New Project from Template
103
107
104
-
#### Create New Project from Template
105
108
The **Python Envs: Create New Project from Template** command simplifies the process of starting a new Python project by scaffolding it for you. Whether in a new workspace or an existing one, this command configures the environment and boilerplate file structure, so you don’t have to worry about the initial setup, and only the code you want to write. There are currently two project types supported:
106
109
107
-
- Package: A structured Python package with files like `__init__.py` and setup configurations.
108
-
- Script: A simple project for standalone Python scripts, ideal for quick tasks or just to get you started.
110
+
-Package: A structured Python package with files like `__init__.py` and setup configurations.
111
+
-Script: A simple project for standalone Python scripts, ideal for quick tasks or just to get you started.
109
112
110
113
## Command Reference
111
114
112
115
All commands can be accessed via the Command Palette (`ctrl/cmd + Shift + P`):
| Create Environment | Create a virtual environment using your preferred environment manager preconfigured with "Quick Create" or configured to your choices. |
117
120
| Manage Packages | Install and uninstall packages in a given Python environment. |
118
121
| Activate Environment in Current Terminal | Activates the currently opened terminal with a particular environment. |
119
122
| Deactivate Environment in Current Terminal | Deactivates environment in currently opened terminal. |
120
123
| Run as Task | Runs Python module as a task. |
121
-
| Create New Project from Template | Creates scaffolded project with virtual environments based on a template. |
124
+
| Create New Project from Template | Creates scaffolded project with virtual environments based on a template. |
The Python Environments extension supports shell startup activation for environments. This feature allows you to automatically activate a Python environment when you open a terminal in VS Code. The activation is done by modifying the shell's startup script, which is supported for the following shells:
186
189
187
190
-**Bash**: `~/.bashrc`
188
-
-**Zsh**: `~/.zshrc`
191
+
-**Zsh**: `~/.zshrc` (or `$ZDOTDIR/.zshrc` if `ZDOTDIR` is set)
189
192
-**Fish**: `~/.config/fish/config.fish`
190
193
-**PowerShell**:
191
194
- (Mac/Linux):`~/.config/powershell/profile.ps1`
@@ -255,7 +258,7 @@ fi
255
258
256
259
### zsh
257
260
258
-
1. Adds or creates `~/.zshrc`
261
+
1. Adds or creates `~/.zshrc` (or `$ZDOTDIR/.zshrc` if `ZDOTDIR` is set)
0 commit comments