Python is a popular programming language that is reliable, flexible, easy to learn, free to use on all operating systems, and supported by both a strong developer community and many free libraries. Python supports all manners of development, including web applications, web services, desktop apps, scripting, and scientific computing and is used by many universities, scientists, casual developers, and professional developers alike. You can learn more about the language on python.org and Python for Beginners.
Visual Studio on Windows provides open-source support for the Python language through the Python development and Data Science workloads (Visual Studio 2017) and the free Python Tools for Visual Studio extension (Visual Studio 2015 and earlier). Python is not presently supported in Visual Studio for Mac, but is available on Mac and Linux through Visual Studio Code (see Q&A below.
To get started:
- Follow the installation instructions to set up the Python workload
- Go through one or more of the Quickstarts to create a project. If you're unsure, start with Create a project from a template.
- Follow the Working with Python in Visual Studio tutorial for a full end-to-end experience.
- Then use the links below to explore Python-related features and the capabilities of Visual Studio itself.
| Feature | Description | General Visual Studio Documentation |
|---|---|---|
| Visual Studio project system | Implicitly picks up a folder structure of Python code while allowing explicit control to identify app code, test code, web pages, JavaScript, build scripts, etc. | Solutions and Projects in Visual Studio |
| Project templates | Quickly creates project structure for console, web, Azure, data science, and other types of projects | Visual Studio Templates |
| Multiple interpreter support | Supports various versions of CPython and IronPython. | n/a |
| IPython support | Includes support for IPython/Jupyter in the REPL for inline plots, .NET, and Windows Presentation Foundation (WPF). | n/a |
| Rich editing, IntelliSense, and code comprehension | Includes syntax coloring, auto-complete across all your code and libraries, code formatting, signature help, class view, Go to Definition, Find All References, code snippets, refactoring, PyLint, and more. | Writing Code in the Code and Text Editor |
| Interactive Window | Provides a quick REPL experience for Python with the ability to easily highlight a portion of your code and send it to the Interactive Window. | n/a |
| Full-featured debugging | Debugging can be done with or without a Visual Studio project, including the ability to debug an existing executable, Python/C++ mixed-mode debugging, remote debugging to Windows/Linux/Mac, remote debugging to Azure, and debugging within the Interactive Window. | Debugging in Visual Studio |
| Profiling tools with comprehensive reporting | Explores how time is being spent within your application, including the ability to compare performance between different profiling runs. | Profiling Tools (not all Visual Studio profiling features are available for Python) |
| Unit testing tools | Discover, run, and manage tests in Visual Studio Test Explorer, and easily debug unit tests. | Unit Test Your Code |
The Python workload also includes the Azure SDK for Python, which simplifies consuming Azure services from Windows, Mac OS X, and Linux apps.
Our series of getting started and deep dive videos on YouTube give you an overview of the primary features.
Questions and answers
Q. Is Python support available with Visual Studio for Mac?
A. Not at this time, though it is requested on UserVoice. The Visual Studio for Mac documentation identifies the current types of development that it does support. In the meantime, Visual Studio Code on Windows, Mac, and Linux works well with Python through available extensions.
Q. What can I use to build UI with Python?
A. The main offering in this area is the Qt Project, with bindings for Python known as PySide (the official binding) (also see PySide downloads) and PyQt. At present, Python support in Visual Studio does not include any specific tools for UI development.
Q. Can a Python project produce a stand-alone executable?
A. Python is generally an interpreted language, with which code is run on demand in a suitable Python-capable environment such as Visual Studio and web servers. Visual Studio itself does not at present provide the means to create a stand-alone executable, which essentially means a program with an embedded Python interpreter. However, there are various means within the Python community to create executables as described on StackOverflow. CPython also supports being embedded within a native application, as described on the blog post, Using CPython's Embeddable Zip File.
Features Matrix
Python support can be installed in the following editions of Visual Studio as described in the installation guide:
- Visual Studio 2017 (all editions)
- Visual Studio 2015 (all editions)
- Visual Studio 2013 Community Edition
- Visual Studio 2013 Express for Web, Update 2 or higher
- Visual Studio 2013 Express for Desktop, Update 2 or higher
- Visual Studio 2013 (Pro edition or higher)
- Visual Studio 2012 (Pro edition or higher)
- Visual Studio 2010 SP1 (Pro edition or higher; .NET 4.5 required)
Supported features by Visual Studio version and edition:
| Python Support | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Multiple interpreters management | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Auto-detect popular interpreters | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Add custom interpreters | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Virtual Environments | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Pip/Easy Install | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Project System | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| New project from existing code | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Show all files | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Source control | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Git integration | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔1 | ✗ |
| Editing | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Syntax highlighting | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Auto-complete | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Signature help | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Quick info | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Object browser/class view | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Navigation bar | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Go to Definition | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Navigate to | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Find All References | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Auto indentation | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Code formatting | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Refactor - rename | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Refactor - extract method | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Refactor - add/remove import | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| PyLint | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Interactive Window | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Interactive Window | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| IPython with inline graphs | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Desktop | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Console/Windows application | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| IronPython WPF (with XAML designer) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| IronPython Windows Forms | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Web | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Django web project | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔ |
| Bottle web project | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔ |
| Flask web project | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔ |
| Generic web project | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔ |
| Azure | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Deploy to web site | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔2 |
| Deploy to web role | ✔ | ✔ | ✔ | ✗ | ✔4 | ✔4 | ✔3 | ✗ |
| Deploy to worker role | ? | ? | ? | ✗ | ✔4 | ✔4 | ✔3 | ✗ |
| Run in Azure emulator | ? | ? | ? | ✗ | ✔4 | ✔4 | ✔3 | ✗ |
| Remote debugging | ✔ | ✔ | ✔ | ✗ | ✔6 | ✔8 | ✔8 | ✗ |
| Server Explorer attach | ✔ | ✔ | ✔ | ✗ | ✔7 | ✔7 | ✗ | ✗ |
| Django templates | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Debugging | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ | ✔ |
| Auto-complete | ✔ | ✔ | ✔ | ✗ | ✔5 | ✔5 | ✔ | ✔ |
| Auto-complete for CSS and JavaScript | ✔ | ✔ | ✔ | ✗ | ✔5 | ✔5 | ✗ | ✗ |
| Debugging | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Debugging | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Debugging without a project | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Debugging - attach to editing | ✔ | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ |
| Mixed-mode debugging | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
| Remote debugging (Windows, Mac OS X, Linux) | ✔ | ✔ | ✔ | ✔ | ✗ | ✔ | ✔ | ✔ |
| Debug interactive window | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Profiling | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Profiling | ✔ | ✔ | ✔ | ✗ | ✗ | ✔ | ✔ | ✔ |
| Test | 2017 | 2015 | 2013 Comm | 2013 Desktop | 2013 Web | 2013 Pro+ | 2012 Pro+ | 2010 SP1 Pro+ |
|---|---|---|---|---|---|---|---|---|
| Test explorer | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
| Run test | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
| Debug test | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✗ |
Git support for VS 2012 is available in the Visual Studio Tools for Git extension, available on the Visual Studio Gallery.
Deployment to Azure Web Site requires Azure SDK for .NET 2.1 - VS 2010 SP1. Later versions don't support VS 2010.
Support for Azure Web Role and Worker Role requires Azure SDK for .NET 2.3 - VS 2012 or later.
Support for Azure Web Role and Worker Role requires Azure SDK for .NET 2.3 - VS 2013 or later.
Django template editor in Visual Studio 2013 has some known issues that are resolved by installing Update 2.
Requires Windows 8 or later. Visual Studio 2013 Express for Web doesn't have the Attach to Process dialog, but Azure Web Site remote debugging is still possible using the Attach Debugger (Python) command in Server Explorer. Remote debugging requires Azure SDK for .NET 2.3 - VS 2013 or later.
Requires Windows 8 or later. Attach Debugger (Python) command in Server Explorer requires Azure SDK for .NET 2.3 - VS 2013 or later.
Requires Windows 8 or later.



