microsoft/vscode-python
forked from DonJayamanne/pythonVSCode
Captured source
source ↗microsoft/vscode-python
Description: Python extension for Visual Studio Code
Language: TypeScript
License: MIT
Stars: 4624
Forks: 1343
Open issues: 357
Created: 2017-10-10T19:37:29Z
Pushed: 2026-06-09T21:01:01Z
Default branch: main
Fork: yes
Parent repository: DonJayamanne/pythonVSCode
Archived: no
README:
Python extension for Visual Studio Code
A Visual Studio Code extension with rich support for the Python language (for all actively supported Python versions), providing access points for extensions to seamlessly integrate and offer support for IntelliSense (Pylance), debugging (Python Debugger), formatting, linting, code navigation, refactoring, variable explorer, test explorer, environment management (NEW Python Environments Extension).
Support for vscode.dev
The Python extension does offer some support when running on vscode.dev (which includes github.dev). This includes partial IntelliSense for open files in the editor.
Installed extensions
The Python extension will automatically install the following extensions by default to provide the best Python development experience in VS Code:
- Pylance – performant Python language support
- Python Debugger – seamless debug experience with debugpy
- (NEW) Python Environments – dedicated environment management (see below)
These extensions are optional dependencies, meaning the Python extension will remain fully functional if they fail to be installed. Any or all of these extensions can be disabled or uninstalled at the expense of some features. Extensions installed through the marketplace are subject to the Marketplace Terms of Use.
About the Python Environments Extension
You may now see that the Python Environments Extension is installed for you, but it may or may not be "enabled" in your VS Code experience. Enablement is controlled by the setting "python.useEnvironmentsExtension": true (or false).
- If you set this setting to
true, you will manually opt in to using the Python Environments Extension for environment management. - If you do not have this setting specified, you may be randomly assigned to have it turned on as we roll it out until it becomes the default experience for all users.
The Python Environments Extension is still under active development and experimentation. Its goal is to provide a dedicated view and improved workflows for creating, deleting, and switching between Python environments, as well as managing packages. If you have feedback, please let us know via issues.
Extensibility
The Python extension provides pluggable access points for extensions that extend various feature areas to further improve your Python development experience. These extensions are all optional and depend on your project configuration and preferences.
If you encounter issues with any of the listed extensions, please file an issue in its corresponding repo.
Quick start
- Step 1. Install a supported version of Python on your system (note: the system install of Python on macOS is not supported).
- Step 2. Install the Python extension for Visual Studio Code.
- Step 3. Open or create a Python file and start coding!
Set up your environment
- Select your Python interpreter by clicking on the status bar
- Configure the debugger through the Debug Activity Bar
- Configure tests by running the
Configure Testscommand
Jupyter Notebook quick start
The Python extension offers support for Jupyter notebooks via the Jupyter extension to provide you a great Python notebook experience in VS Code.
- Install the Jupyter extension.
- Open or create a Jupyter Notebook file (.ipynb) and start coding in our Notebook Editor!
For more information you can:
- Follow our Python tutorial with step-by-step instructions for building a simple app.
- Check out the Python documentation on the VS Code site for general information about using the extension.
- Check out the Jupyter Notebook documentation on the VS Code site for information about using Jupyter Notebooks in VS Code.
Useful commands
Open the Command Palette (Command+Shift+P on macOS and Ctrl+Shift+P on Windows/Linux) and type in one of the following commands:
| Command | Description | | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Python: Select Interpreter | Switch between Python interpreters, versions, and environments. | | Python: Start Terminal REPL | Start an interactive Python REPL using the selected interpreter in the VS Code terminal. | | Python: Run Python File in Terminal | Runs the active Python file in the VS Code terminal. You can also run a Python file by right-clicking on the file and selecting Run Python File in Terminal. | | Python: Configure Tests | Select a test framework and configure it to display the Test…
Excerpt shown — open the source for the full document.