Author: Courtney Webster - Program Manager, Python Extension in Visual
Studio Code
Typesetting: Alan Wang
We’re excited to announce that the Python and Jupyter extensions for Visual Studio Code will be released in September 2023!
This release includes the following:
• Added Python "Recreate" or "Use Existing" options to Python : Create Environment
• Experimental terminal activation using environment variables
• Community-contributed yapf extension
If you're interested, you can check out the full list of improvements in our Python , Jupyter and Pylance extension changelog.
Add Python's "Recreate" or "Use Existing" option to Python: Create Environment
When working in a workspace that already contains .venv
a folder, the "Python: Create Environment" command has been updated to give you the option to recreate or use an existing environment. If you choose to recreate the environment, your current .venv
environment will be deleted, allowing you to recreate a .venv
new environment named . You can customize this new environment by following the Python: Create Environment process, selecting your preferred interpreter, and specifying any dependency files to install. If the environment cannot be deleted, for example, because the environment is active, you will be prompted to delete the environment manually.
Alternatively, if you choose to use an existing environment, that environment is selected for the workspace.
“Recreate” or “Use Existing” option
Experimental terminal activation using environment variables
This month we will start rolling out terminal activation using environment variables that activate selected environments in the terminal without any activation commands. With this new experience, the Python extension uses environment variables to activate the terminal, which is done implicitly when the terminal is started, resulting in a faster experience, especially for conda users. This experiment will serve as ["pythonTerminalEnvVarActivation"]
the default experience for the 25% of pre-release users behind the experiment flag. You can opt in or out of this experiment by settings.json
editing in Settings "python.experiments.optInto"
or . "python.experiments.optOutFrom"
If you have any comments or suggestions about this experience, please share them in vscode-python#11039 .
Community contributed yapf extension
There is now a community-contributed ( @EeyoreLee ) yapf formatter extension available! This extension provides yapf format support for Python files and jupyter cells. Yapf support built into Python extensions will be deprecated in favor of extension support. Subsequently, the corresponding setting python.formatting.yapf
will be removed from the Python extension.
This corresponds to work announced in August 2022 to break support for the tools provided in the Python extension for Visual Studio Code into separate extensions, with the goal of improving performance and stability, and removing the need to install these tools in the Python environment Medium - as they can be provided with extensions.
Other changes and enhancements
We've also added small user-requested enhancements and fixed issues that should improve your experience using Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:
- Unresolved import errors now indicate in which environment Pylance looks for the package ( pylance-release#4368 )
- There is a
python.analysis.enableSyncServer
new experimental setting called to enable multi-file IntelliSense support in vscode.dev . Support for github.dev and virtual workspaces is coming soon ! - Pylance no longer crashes on Jupyter notebook cell deletion ( @pylance-release#4685 )
- There is a new dedicated topic on Python formatting in our documentation , where you will learn how to set a default formatter (such as autopep8 or black formatter ) and customize it with various settings.
We would also like to give a special thanks to this month’s contributors:
- @chrissiwaffler made their first contribution in vscode -python-tools-extension-template#126
- @oliversen made their first contribution in vscode -python-tools-extension-template#145
- @EeyoreLee made their first contribution in vscode -python-tools-extension-template#155 .
- @rachfop made their first contribution in vscode -python-tools-extension-template#41 .
- @34j made their first contribution in vscode -python-tools-extension-template#59 .
- @augb made their first contribution in vscode -python-tools-extension-template#72 .
- @eddyg made their first contribution in vscode -python-tools-extension-template#84 .
- @ischaojie made their first contribution in vscode -python-tools-extension-template#92 .
Solicit community feedback
As we plan and prioritize future work, we value your feedback! Here are a few questions we would like feedback on:
- Future design of Python Testing output ( vscode-python#21861 )
Try these new improvements by downloading Python extensions and Jupyter extensions from the Marketplace , or install them directly from the Extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X). You can learn more about Python support in Visual Studio Code in the documentation . If you encounter any problems or have suggestions, please submit an issue on the Python VS Code GitHub page .