Python in Visual Studio Code – August 2021 Release

Luciana

We are pleased to announce that the August 2021 release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can learn more about  Python support in Visual Studio Code in the documentation.

This was a short release as we are now adjusting our release cadence to match that of VS Code (speaking of which, make sure to check the VS Code release notes to see what’s new for all languages!). We’re excited to announce that the revamped Jupyter notebooks experience brought by the Jupyter extension is now out of preview, and that we have an improved way of sorting Python interpreters on the selection list.

If you’re interested, you can check the list of improvements in our changelog.

Revamped Jupyter Notebooks Experience

In July 2020, we had announced the preview of the new experience for Jupyter notebooks in VS Code. We’re excited that this much faster and feature-rich experience is now out of preview and available to all users of VS Code.

New Jupyter notebooks rendering and experience in VS Code
Theme: Eva Light Bold

With this revamped experience, all the things you love about VS Code are better integrated:

  • Source control diffing: cell changes are now easier to parse and to inspect in the source control view – you can even customize what types of changes you want displayed.
  • Key-bindings: default VS Code shortcuts as well as those provided by keymap extensions (e.g. VIM) are now supported on notebook files.
  • High customization ability: customization of appearance or placement of many of the UI notebook elements – you can check all available settings by opening the Settings UI (File > Preferences > Settings and search for “Notebook”.View of a few notebook customization settings

You can learn more about Jupyter notebook support in VS Code on the documentation.

Improved sorting of Python interpreters

Previously, when running the “Python: Select Interpreter” command, the Python extension would display the list of all the Python interpreters it could find ordered alphabetically. When there are many Python environments on a machine, this often led to additional steps for interpreter selection that involved searching and a lot of scrolling. To make that process faster, we are now displaying the list of interpreters in a way so that the one you are most likely to want for your project shows first on the list and is easier to find. The order in which they are now displayed is the following:

  1. Environments located in the same path as the workspace root;
  2. Globally-installed environments (e.g. $WORK_ON or conda);
  3. Global installs (e.g. /usr/bin/python3.9)

The Python interpreters with higher versions for each of those categories are displayed first.

List of Python interpreters listed in the new sorting order

Other Changes and Enhancements

We also want to thank the following people who contributed this month to the Python extension in Visual Studio Code:

Be sure to download the Python extension for Visual Studio Code now to try out the above improvements. If you run into any problems or have suggestions, please file an issue on the Python VS Code GitHub page.

0 comments

Leave a comment