Text of code.visualstudio.com › docs › python › settings-reference as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Python settings reference

AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. Join VS Code at Microsoft Ignite or catch the sessions online. A year of VS Code, wrapped. Explore the highlights. Python settings reference View as Markdown Ask in VS Code Ask in VS Code Insiders The Python Extension for Visual Studio Code is highly configurable.

This page describes the key settings you can work with. For general information about working with settings in VS Code, refer to User and workspace settings , as well as the Variables reference for information about predefined variable support. General Python settings Setting (python.) Default Description condaPath "conda" Path to the conda executable. defaultInterpreterPath "python" Path to the default Python interpreter to be used by the Python extension on the first time it loads for a workspace, or the path to a folder containing the Python interpreter.

Can use variables like ${workspaceFolder} and ${workspaceFolder}/.venv . Using a path to a folder allows anyone working with a project to create an environment in the .venv folder as appropriate to their operating system, rather than having to specify an exact platform-dependent path. The settings.json file can then be included in a source code repository. Note : Changes to this setting made after an interpreter has been selected for a workspace will not be applied or considered by the Python extension.

The Python extension doesn't automatically add or change this setting. envFile "${workspaceFolder}/.env" Absolute path to a file containing environment variable definitions. See .env file support . experiments.enabled true Enables A/B experiments in the Python extension . If enabled, you may be provided with proposed enhancements and/or features. globalModuleInstallation false Specifies whether to install packages for the current user only using the --user command-line argument (the default), or to install for all users in the global environment (when set to true ).

Ignored when using a virtual environment. For more information on the --user argument, see pip - User Installs . interpreter.infoVisibility "onPythonRelated" Controls when to display the selected interpreter information on the status bar. By default, it only shows when there are Python related files open in the editor. You can set it to "always" if you'd like it to always show on the status bar, or "never" to hide it entirely. pipenvPath "pipenv" Path to the pipenv executable to use for activation. poetryPath "poetry" Specifies the location of the Poetry dependency manager executable, if installed.

The default value "poetry" assumes the executable is in the current path. The Python extension uses this setting to install packages when Poetry is available and there's a poetry.lock file in the workspace folder. REPL.enableREPLSmartSend true Specifies whether Shift+Enter leverage Smart Send. Smart Send looks at the code where the cursor is placed, sends the smallest runnable chunk of code to the Python REPL, and then places your cursor at the next line of code. terminal.activateEnvInCurrentTerminal false Specifies whether to activate the currently open terminal when the Python extension is activated, using the virtual environment selected. terminal.activateEnvironment true Indicates whether to automatically activate the environment you select using the Python: Select Interpreter command when a new terminal is created.

For example, when this setting is true and you select a virtual environment, the extension automatically runs the environment's activate command when creating a new terminal ( source env/bin/activate on macOS/Linux; env\scripts\activate on Windows). Note : This setting is superseded by python-envs.terminal.autoActivationType when that setting is configured. terminal.executeInFileDir false Indicates whether to run a file in the file's directory instead of the current folder. terminal.focusAfterLaunch false Whether to switch the cursor focus to the terminal when launching a Python terminal. terminal.launchArgs [] Launch arguments that are given to the Python interpreter when you run a file using commands such as Python: Run Python File in Terminal .

In the launchArgs list, each item is a top-level command-line element that's separated by a space (quoted values that contain spaces are a single top-level element and are thus one item in the list). For example, for the arguments --a --b --c {"value1" : 1, "value2" : 2} , the list items should be ["--a", "--b", "--c", "{\"value1\" : 1, \"value2\" : 2}\""] . Note that VS Code ignores this setting when debugging because it instead uses arguments from your selected debugging configuration in launch.json . terminal.useEnvFile false Controls whether environment variables from env files and python.envFile setting are injected into terminals. venvFolders [] Paths to folders where virtual environments are created.

Depending on the virtualization tool used, it can be the project itself: ${workspaceFolder} , or separate folders for all virtual environments located side by side: .\envs , ~/.virtualenvs , and so on. Note : This setting is automatically merged with python-envs.globalSearchPaths . Consider migrating to the new setting for additional features. Python Environments extension settings The Python Environments extension provides environment and package management within the VS Code UI.

These settings control environment discovery, creation, and terminal activation. For more information about environment management, see Python environments . Environment management settings Setting (python-envs.) Default Description defaultEnvManager "ms-python.python:venv" The default environment manager for creating and managing environments. defaultPackageManager "ms-python.python:pip" The default package manager for installing packages in environments. pythonProjects [] The list of Python projects.

Each item is an object with properties: path (string), envManager (string), packageManager (string). Use this to configure per-folder environments in multi-root workspaces. workspaceSearchPaths ["./**/.venv"] Glob patterns to search for environments in this workspace. By default, searches for any folder named .venv anywhere in your workspace. Note : This setting must be configured at the workspace or folder level, not user level. globalSearchPaths [] Absolute paths to search for Python environments across all workspaces.

Use for shared environment folders like ~/envs . Note : Legacy settings python.venvPath and python.venvFolders are automatically merged with this setting. alwaysUseUv true When set to true , uv will be used to manage all virtual environments if available. When set to false , uv will only manage virtual environments explicitly created by uv. Terminal settings Setting (python-envs.terminal.) Default Description autoActivationType "command" Specifies how the extension activates an environment in a terminal.

Available values: command (activation by executing a command in terminal), shellStartup (activation using shell integration or by modifying terminal shell startup script, supported for zsh, fish, pwsh, bash, cmd), off (no automatic activation). Note : This setting takes precedence over python.terminal.activateEnvironment . showActivateButton false (Experimental) Whether to show the 'Activate' button in the terminal menu.

Legacy settings migration If you're migrating from older Python extension settings, the following table shows the mapping to new settings: Legacy Setting New Setting Notes python.venvPath python-envs.globalSearchPaths or python-envs.workspaceSearchPaths Legacy setting still works and is merged automatically. Consider migrating to use glob patterns. python.venvFolders python-envs.globalSearchPaths or python-envs.workspaceSearchPaths Legacy setting still works and is merged automatically. python.terminal.activateEnvironment python-envs.terminal.autoActivati

The rest of this page is on the live site.