Python extension for Visual Studio Code

repository·main·Indexed 26 days ago

https://github.com/microsoft/vscode-python

Python language support for Visual Studio Code, providing IntelliSense (Pylance), debugging, environment management, linting, formatting, refactoring, and unit testing. Includes support for Jupyter Notebooks, a Python extension API for third-party extensions to interact with environments and debugging, and tools for managing Python interpreters and kernels.

Tokens
8.8K
Snippets
21
Records
66
Agent score
88%

What's inside vscode-python

  1. Install Python on Debian-based Linux distributions

    main

    To install the latest version of Python along with python3-venv and python3-pip on Debian-based distributions, run the following commands in your terminal:

    1. Update the package index: sudo apt-get update
    2. Install the packages: sudo apt-get install python3 python3-venv python3-pip
    sudo apt-get update
    sudo apt-get install python3 python3-venv python3-pip
  2. Configure your Python environment and debugger

    main

    Once the extension is installed, you can set up your development environment using the following methods:

    • Select Interpreter: Click on the Python interpreter name in the status bar to switch between different Python versions, interpreters, and environments.
    • Configure Debugger: Use the Debug Activity Bar to set up your debugging configuration.
    • Configure Tests: Run the Python: Configure Tests command to select a test framework (like unittest or pytest) and enable the Test Explorer.
  3. Configure dependencies to use the Python extension API

    main

    To use the Python extension's API facade in your own VS Code extension, you must declare ms-python.python as an extension dependency in your package.json. Additionally, add @vscode/python-extension and @types/vscode to your project dependencies. It is recommended to use a recent version of @types/vscode (e.g., ^1.81.0) to avoid conflicts.

    {
    	"name": "...",
    	...
    	// depend on the Python extension
    	"extensionDependencies": [
    		"ms-python.python"
    	],
    	// Depend on the Python extension facade npm module to get easier API access to the
    	// core extension.
    	"dependencies": {
    		"@vscode/python-extension": "...",
    		"@types/vscode": "..."
    	}
    }