This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Python support is available only on Visual Studio for Windows. On Mac and Linux, Python support is available throughVisual Studio Code.
Note
You also need a Python interpreter installed in order to work with Python in Visual Studio. We recommend installing one frompython.org or Anaconda. For more information on Python interpreters, seeInstalling Python Interpreters.
Complete the following steps to download and install the Python workload.
Download and run the latest Visual Studio Installer for Windows. Python support is present in release 15.2 and later. If you have Visual Studio installed already, open Visual Studio and run the installer by selectingTools >Get Tools and Features.
Tip
The Community edition is for individual developers, classroom learning, academic research, and open source development. For other uses, installVisual Studio Professional orVisual Studio Enterprise.
The installer provides a list of workloads that are groups of related options for specific development areas. For Python, select thePython development workload and selectInstall:
Python installation options | Description |
---|---|
Python distributions | Choose any combination of Python distribution that you plan to work with. Common options include 32-bit and 64-bit variants of Python 2, Python 3, Miniconda, Anaconda 2, and Anaconda 3. Each option includes the distribution's interpreter, runtime, and libraries. Anaconda, specifically, is an open data science platform that includes a wide range of preinstalled packages. Visual Studio automatically detects existing Python installations. For more information, seeThe Python Environments window. Also, if a newer version of Python is available than the version shown in the installer, you can install the new version separately and Visual Studio detects it. |
Cookiecutter template support | Install the Cookiecutter graphical UI to discover templates, input template options, and create projects and files. For more information, seeUse the Cookiecutter extension. |
Python web support | Install tools for web development including HTML, CSS, and JavaScript editing support, along with templates for projects using the Bottle, Flask, and Django frameworks. For more information, seePython web project templates. |
Python native development tools | Install the C++ compiler and other necessary components to develop native extensions for Python. For more information, seeCreate a C++ extension for Python. Also install theDesktop development with C++ workload for full C++ support. |
By default, the Python workload installs for all users on a computer under:
%ProgramFiles%\Microsoft Visual Studio\<VS_version>\<VS_edition>Common7\IDE\Extensions\Microsoft\Python
where<VS_version> is 2022 and<VS_edition> is Community, Professional, or Enterprise.
%ProgramFiles(x86)%\Microsoft Visual Studio\<VS_version>\<VS_edition>Common7\IDE\Extensions\Microsoft\Python
where<VS_version> is 2019 or 2017 and<VS_edition> is Community, Professional, or Enterprise.
Quickly check your installation of Python support:
Launch Visual Studio.
Select Alt + I to open thePython Interactive window.
In the window, enter the statement2+2
.
The statement output4
displays in the window. If you don't see the correct output, recheck your steps.
Was this page helpful?
Was this page helpful?