Skip to content
Python extension for Visual Studio Code
Branch: master
Clone or download
#6606 Compare This branch is 14 commits ahead of DonJayamanne:master.
DavidKutu auto detect environment when installing jupyter (#6629)
* instead of asking the user to select an
installer, we now autodetect the
environment being used, and use that installer.

* added comments and a constant for a product name

* changed errorHandler to use the installer with most
priority, fixed channelManager so it returns the highest priority
installer, increased the priority of the conda installer to 1

* updated the condaInstaller unit tests and
changed channel manager to return all supported installers.

* Added InstrallerNames.ts with an enum and a Map to
help identify the installers used by the extension.
Also updated all installers to use it. And returned channel
Manager to work as it used to.

* removed installerNames.ts and added 'name' to the
IModuleInstaller, to be able to use it in code to identify
the different installers.
Latest commit 68c0333 Jul 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.devcontainer Make sure language is used when picking kernel specs (#5628) May 14, 2019
.github Fix typos (#6470) Jul 9, 2019
.vscode Added ability to auto update Insiders build of extension (#6308) Jul 11, 2019
build Remove ptvsd test req (#6611) Jul 16, 2019
data Make sure language is used when picking kernel specs (#5628) May 14, 2019
images Update README to include new features (#5297) Apr 16, 2019
languages Introduce pip requirements file highlighting Sep 27, 2017
news auto detect environment when installing jupyter (#6629) Jul 19, 2019
pythonFiles Fixes pytest discovery: Not all pytest items have `own_markers` (#6514) Jul 11, 2019
resources Accessibility fixes for interactive window (#6011) Jun 13, 2019
schemas Add 'pip' to conda environment.yml schema (#2120) Aug 1, 2018
snippets Make it easier to add Cells (#6558) Jul 17, 2019
src auto detect environment when installing jupyter (#6629) Jul 19, 2019
syntaxes Delete unused test language files (#298) Nov 27, 2017
tpn Upgrade Jedi to version 0.13.3. (#6317) Jun 25, 2019
types Plot window support (#5964) Jun 11, 2019
typings Ensure code compiles in strict mode (#4044) Jan 18, 2019
uitests Fix typos (#6470) Jul 9, 2019
.editorconfig #1228 multi root master (#2) Nov 1, 2017
.env UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
.eslintrc fix #1276 Pre-commit hooks to ensure code complies with standards (#1277 Oct 12, 2017
.gitattributes Make npm happy in regards to line endings (#357) Dec 6, 2017
.gitignore UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
.npmrc added .npmrc Oct 18, 2016
.nvmrc Update to node 10 (#5203) Apr 12, 2019
.vscodeignore UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
CHANGELOG.md Cherry pick release 2019.6.1 into master (#6519) Jul 10, 2019
CODE_OF_CONDUCT.md Legal stuff to make CELA happy (#5) Nov 2, 2017
CODING_STANDARDS.md Mention which style guide takes precedence and import practices Apr 10, 2018
CONTRIBUTING.md Fix typos (#6470) Jul 9, 2019
LICENSE Legal stuff to make CELA happy (#5) Nov 2, 2017
PYTHON_INTERACTIVE_TROUBLESHOOTING.md Update PYTHON_INTERACTIVE_TROUBLESHOOTING.md (#3385) Nov 17, 2018
README.md specify fully https path to README images (#5307) Apr 16, 2019
ThirdPartyNotices-Distribution.txt Upgrade Jedi to version 0.13.3. (#6317) Jun 25, 2019
ThirdPartyNotices-Repository.txt Perf fixes for the interactive window (#6566) Jul 15, 2019
experiments.json Enable experiment for always displaying the test explorer (#6330) Jun 25, 2019
gulpfile.js Fix typos (#6470) Jul 9, 2019
icon.png moved icon Jul 2, 2017
package-lock.json Don't start the restart session until first session succeeds (#6652) Jul 19, 2019
package.datascience-ui.dependencies.json Perf fixes for the interactive window (#6566) Jul 15, 2019
package.json Add new code lens for jumping into the interactive window where a cel… Jul 18, 2019
package.nls.de.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.es.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.fr.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.it.json Fix up the debug config labels and messages. (#5353) Apr 18, 2019
package.nls.ja.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.json Add new code lens for jumping into the interactive window where a cel… Jul 18, 2019
package.nls.ko-kr.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.nl.json Fix sentence case and IPython stylization (#6567) Jul 13, 2019
package.nls.pl.json New command to run all of file regardless of cells (#4893) Mar 22, 2019
package.nls.pt-br.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.ru.json Fix up the debug config labels and messages. (#5353) Apr 18, 2019
package.nls.zh-cn.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
package.nls.zh-tw.json remove unexpected trailing commas in JSON files (#5443) Apr 24, 2019
requirements.txt Upgrade Jedi to version 0.13.3. (#6317) Jun 25, 2019
tsconfig.datascience-ui.json UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
tsconfig.extension.json UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
tsconfig.json UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
tsfmt.json #1228 multi root master (#2) Nov 1, 2017
tslint.json UI Tests for the extension using selenium and behave (#5912) Jul 1, 2019
vscode-python-signing.csproj VS Python analysis engine integration (#1231) Mar 30, 2018
webpack.config.js Fix fontkit breaking vsix (#5975) Jun 11, 2019
webpack.datascience-ui.config.js Plot window support (#5964) Jun 11, 2019

README.md

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: 2.7, >=3.5), including features such as IntelliSense, linting, debugging, code navigation, code formatting, Jupyter notebook support, refactoring, variable explorer, test explorer, snippets, and more!

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

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.
Python: Select Linter Switch from Pylint to Flake8 or other supported linters.
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.

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, pytest or nose

  • Jupyter Notebooks: Define and run code cells, render plots, visualize variables through the variable explorer and more

  • Environments: Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments

  • Refactoring: Restructure your Python code with variable extraction, method extraction and import sorting

Supported locales

The extension is available in multiple languages thanks to external contributors (if you would like to contribute a translation, see the pull request which added Italian): de, en, es, fr, it, ja, ko-kr, pt-br, ru, 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 file a new issue
  • 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.

You can’t perform that action at this time.