Skip to content

microsoft/vscode-python

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Kartik Raj
Oct 24, 2023
bac0e78 · Oct 24, 2023
Oct 2, 2023
Oct 10, 2023
Oct 10, 2023
Oct 18, 2023
Jan 6, 2022
Aug 9, 2021
Sep 27, 2017
Oct 2, 2023
Oct 20, 2023
Oct 12, 2023
Sep 3, 2020
Sep 12, 2023
Oct 24, 2023
Apr 1, 2020
Aug 23, 2023
Oct 20, 2023
Nov 1, 2017
Jul 14, 2023
Aug 10, 2021
Apr 21, 2020
Aug 3, 2023
Mar 8, 2020
Oct 2, 2023
Dec 21, 2020
Aug 10, 2021
Jan 31, 2023
Aug 2, 2022
Apr 12, 2021
Apr 13, 2021
Nov 2, 2017
Oct 12, 2023
Apr 1, 2020
Oct 2, 2020
Oct 18, 2023
May 30, 2022
Oct 2, 2023
Jul 2, 2017
Oct 18, 2023
Oct 20, 2023
Oct 19, 2023
Jul 5, 2023
Oct 19, 2023
Jun 29, 2022
Jan 11, 2022
Aug 10, 2021
Jul 14, 2023
Feb 20, 2020
Mar 30, 2018

Repository files navigation

Python extension for Visual Studio Code

A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: >=3.7), including features such as IntelliSense (Pylance), linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more!

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 Pylance extension to give you the best experience when working with Python files. However, Pylance is an optional dependency, meaning the Python extension will remain fully functional if it fails to be installed. You can also uninstall it at the expense of some features if you’re using a different language server.

Extensions installed through the marketplace are subject to the Marketplace Terms of Use.

Quick start

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 Tests command

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:

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 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.
Format Document Formats code using the provided formatter in the settings.json file.
Python: Configure Tests Select a test framework and configure it to display the Test Explorer.

To see all available Python commands, open the Command Palette and type Python. For Jupyter extension commands, just type Jupyter.

Feature details

Learn more about the rich features of the Python extension:

  • IntelliSense: Edit your code with auto-completion, code navigation, syntax checking and more
  • Linting: Get additional code analysis with Pylint, Flake8 and more
  • Code formatting: Format your code with black, autopep or yapf
  • Debugging: Debug your Python scripts, web apps, remote or multi-threaded processes
  • Testing: Run and debug tests through the Test Explorer with unittest or pytest.
  • Jupyter Notebooks: Create and edit Jupyter Notebooks, add and run code cells, render plots, visualize variables through the variable explorer, visualize dataframes with the data viewer, and more
  • Environments: Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments
  • Refactoring: Restructure your Python code with variable extraction and method extraction. Additionally, there is componentized support to enable additional refactoring, such as import sorting, through extensions including isort and Ruff.

Supported locales

The extension is available in multiple languages: de, en, es, fa, fr, it, ja, ko-kr, nl, pl, pt-br, ru, tr, zh-cn, zh-tw

Questions, issues, feature requests, and contributions

  • If you have a question about how to accomplish something with the extension, please ask on Stack Overflow
  • If you come across a problem with the extension, please file an issue
  • Contributions are always welcome! Please see our contributing guide for more details
  • Any and all feedback is appreciated and welcome!
    • If someone has already filed an issue that encompasses your feedback, please leave a 👍/👎 reaction on the issue
    • Otherwise please start a new discussion
  • If you're interested in the development of the extension, you can read about our development process

Data and telemetry

The Microsoft Python Extension for Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. This extension respects the telemetry.enableTelemetry setting which you can learn more about at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.

About

Python extension for Visual Studio Code

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages

  • TypeScript 90.9%
  • Python 8.4%
  • JavaScript 0.5%
  • Jupyter Notebook 0.2%
  • Shell 0.0%
  • Dockerfile 0.0%