Python in Visual Studio Code – May 2020 Release

Luciana Abud

We are pleased to announce that the May 2020 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.  

In this release we addressed 42 issues, and it includes the ability to browse for or enter an interpreter path on selectionIf you’re interested, you can check the full list of improvements iour changelog. 

Ability to browse for interpreter path  

To make selecting or changing interpreter easier, you now have the option to browse for a Python interpreter in your file systemYou can also set an interpreter by manually entering its path:

Selecting an interpreter by entering a path and then by browsing for executable file on the system file explorer.Theme: Eva

Coming Next: moving python.pythonPath out of settings.json 

One change that is coming relates to how the Python extension handles Python interpreter selection. Currently the path to the selected interpreter is stored in the workspace settings. This can be a problem when you share VS Code workspace settings in a GitHub repo, for example, as reported in our issue tracker. 

In order to make the interpreter information system agnostic and prevent sharing the interpreter path (which commonly won’t be the same across different machines), we’re going to deprecate the python.pythonPath setting in the Python extension.  You will still be able to set interpreters per workspace, it’ll just be stored internally instead of the workspace settings. 

These changes will be added gradually as an experiment. If you’re interested to try it ahead of time, you can opt into this functionality by adding the following line to your User settings (View Command Palette… and run Preferences: Open Settings (JSON)) and then reloading the window (View Command Palette… and run Developer: Reload Window): 

"python.experiments.optInto": ["DeprecatePythonPath - experiment"]

To see if you are part of an experiment, you can check the first lines in the Python extension output channel. If you wish to opt-out of A/B testing in general, you can open the user settings.json file and set the “python.experiments.enabled” setting to false. 

We also have some additional announcements coming soon, so stay tuned! 

Other Changes and Enhancements 

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. Some notable changes include: 

  • CVE-2020-1171Do not perform pipenv interpreter discovery on extension activation. (#11127) 
  • CVE-2020-1192: Setting “Data Science: Run Startup Commands” is now limited to being a User scope only setting.
  • Performance improvements when executing multiple cells in Notebook and Interactive Window using ipywidgets. (#11576) 
  • Fix for opening the interactive window when no workspace is open. (#11291) 
  • Update Jedi 0.17 (thanks Peter Law) (#11221)

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