Python Venv SwitcherAutomatic virtual environment switching for Python monorepos. Venv Switcher automatically finds and activates the correct Python virtual environment in VS Code for the current file. FeaturesAutomatically detects virtual environments managed by:
Supports most project layouts:
SettingsCreate WorkspaceSetting key: VS Code only allows a virtual environment to be set if a workspace is open. When an environment is detected for an open file but no workspace is open, this setting controls whether a new workspace is created to activate the virtual environment. Custom ProviderSetting key: A command that returns the full path to the virtual environment's Python executable. If set, overrides the default environment resolution logic. For example, use CWD TemplateSetting key: If set, update the For example, use
CommandsActivate Python EnvironmentManually trigger the environment resolution for the current file.
Run this command if the environment has changed, such as after running Reset Venv Switcher CacheRe-check for supported virtual environment providers and forget previously resolved environments. Run this command after installing a supported environment provider, such as Poetry. (Providers are checked when the extension is first activated, and when the Custom Provider setting is modified.) |