Install the Python extension

Completed

When Visual Studio Code is installed, you can install the Python extension, and, optionally, set up other tools and settings.

Install the Python extension for Visual Studio Code

Visual Studio Code is a powerful code editor and a lightweight general-purpose integrated development environment (IDE) with a wide range of extensions available to provide functionality in various programming languages. The Python extension for Visual Studio Code provides visual cues, such as color coding and autocomplete, and debugging tools to help you write better Python code, and to write code faster. This exercise installs the Python extension to your existing VS Code application.

  1. In Visual Studio Code, select View > Extensions to open the Extensions view.

    Screenshot of the menu option for the Extensions view.

    The Visual Studio Code Extensions view lists the installed extensions and recommended extensions from the most popular on Marketplace.

  2. Filter the list of available extensions by entering python in the search box at the top of the Extensions view.

  3. Select the Python extension published by Microsoft (described as IntelliSense (Pylance) and usually the first one in the list). The details about that extension appear in a tabbed panel on the right.

  4. In either the Extensions panel, or in the main panel, select Install.

    Screenshot of the search results in the Extensions panel for Windows with Python Install highlighted.

    When the installation is complete, the Install button changes to a Settings ⚙️ icon in the Extensions view or two buttons, Disable and Uninstall in the main panel. This message lets you know that you've successfully installed the Python extension for Windows.

    Screenshot of the Extensions panel for Windows with Python extension installed.

    Screenshot of the search results in the Extensions panel for Linux with Install Python highlighted.

    When the installation is complete, the Install button changes to a Settings ⚙️ icon in the Extensions view or two buttons, Disable and Uninstall in the main panel. This message lets you know that you've successfully installed the Python extension for Linux/UNIX.

    Screenshot of the search results in the Extensions panel for macOS with Python Install highlighted.

    When the installation is complete, the Install button changes to a Settings ⚙️ icon in the Extensions view or two buttons, Disable and Uninstall in the main panel. This message lets you know that you've successfully installed the Python extension for macOS.

    Important

    After you install the Python extension, you may see a dialog box that asks you whether you want to install the command line developer tools. You should select Install. You'll need to agree to the Command Line Tools License Agreement. The installation process could take as long as 20 minutes or more, depending on your internet connection. After the install is complete, a dialog box appears stating that the software is installed. Select Done to proceed.

Summary

You've successfully installed the Python extension for Visual Studio Code. Let's create our first Python application!