Upgrade python version in visual studio code python workspace

In my earlier article, I have explained how to upgrade Python on macOS and setup Visual Studio Code project for Python development. Now we will see how to upgrade the already setup Python environment in VS Code workspace.

In my current Python workspace, the interpreter is pointing to a virtual environment with Python 3.7.3. To upgrade this to version 3.7.4, I’ve followed these steps.

Caution

When upgrading the python interpreter version in python workspace, you may encounter errors or warnings while running the project because of incompatible usage of methods or objects. So please review the release documents from python.org before upgrading and prepare an action plan to migrate the code to new version of Python.

Prerequisites

Steps to upgrade Python in workspace

  1. Launch the Visual Studio Code python workspace.
  2. Open the Command Palette, by pressing Shift, Command and P keys.
  3. In the Command Palette, type in and select Python: Select Interpreter.
  4. The available interpreters will be listed. You can see the newly upgraded version (3.7.4) of python global environment and the virtual environment listed.
  5. Select the virtual environment Python 3.7.4 64-bit (‘env’: venv). Upgrade python version in visual studio code python workspace
  6. From now on, the VS Code workspace will use the environment with the new version of Python. Change python eenvironment in VS Code

Tools & Technologies Used

  • macOS Mojave (10.14.6)
  • Visual Studio Code (1.37.1)
  • Python (3.7.4)

Related Articles & Tools

Leave your thoughts...

This site uses Akismet to reduce spam. Learn how your comment data is processed.