Behaviour
The Python extension fails to activate when python.useEnvironmentsExtension is false in user settings and true in workspace settings.
Steps to reproduce
-
Start VS Code with empty --user-data-dir and --extensions-dir directories.
-
Install only the latest stable Python Environments extension, Pylance, and Python extension.
-
Add this user setting:
{
"python.useEnvironmentsExtension": false
}
-
Open a folder with this workspace setting:
{
"python.useEnvironmentsExtension": true
}
-
Open a Python file.
Expected behaviour
The Python extension activates without an exception. If the Python Environments extension declines activation, the Python extension uses its legacy environment path.
This follows the current cross-extension contract: any explicit false disables the Python Environments extension window-wide. This issue concerns inconsistent activation checks, not configuration-scope precedence.
Actual behaviour
The effective workspace value makes useEnvExtension() return true, but the Python Environments extension declines activation because it finds an explicit false at user scope and exports no API. getEnvExtApi() then dereferences the undefined export:
Activating extension ms-python.python failed
TypeError: Cannot read properties of undefined (reading 'onDidChangeEnvironment')
at .../ms-python.python-2026.4.0-darwin-arm64/dist/extension.js
shouldEnvExtHandleActivation() already mirrors the Python Environments extension's explicit-disable rules, but useEnvExtension() only checks the effective configuration value.
Environment
- VS Code: 1.130.0
- Python extension: 2026.4.0 (Marketplace stable); also reproduced from current
main at 757def8f844b2241f041c1d74435740fa621a8c5
- Python Environments extension: 1.36.0
- Pylance: 2026.3.1
- OS: macOS 15.3.2 arm64
- Workspace: single-folder
Isolated verification
- Stable extensions + conflicting settings: reproduces the exception.
- Patched Python VSIX + the same settings: activates and uses the legacy locator.
- Stable extensions + the user-level
false removed: Python Environments starts and discovers backend/.venv.
AI disclosure: Prepared with assistance from OpenAI Codex.
Behaviour
The Python extension fails to activate when
python.useEnvironmentsExtensionisfalsein user settings andtruein workspace settings.Steps to reproduce
Start VS Code with empty
--user-data-dirand--extensions-dirdirectories.Install only the latest stable Python Environments extension, Pylance, and Python extension.
Add this user setting:
{ "python.useEnvironmentsExtension": false }Open a folder with this workspace setting:
{ "python.useEnvironmentsExtension": true }Open a Python file.
Expected behaviour
The Python extension activates without an exception. If the Python Environments extension declines activation, the Python extension uses its legacy environment path.
This follows the current cross-extension contract: any explicit
falsedisables the Python Environments extension window-wide. This issue concerns inconsistent activation checks, not configuration-scope precedence.Actual behaviour
The effective workspace value makes
useEnvExtension()returntrue, but the Python Environments extension declines activation because it finds an explicitfalseat user scope and exports no API.getEnvExtApi()then dereferences the undefined export:shouldEnvExtHandleActivation()already mirrors the Python Environments extension's explicit-disable rules, butuseEnvExtension()only checks the effective configuration value.Environment
mainat757def8f844b2241f041c1d74435740fa621a8c5Isolated verification
falseremoved: Python Environments starts and discoversbackend/.venv.AI disclosure: Prepared with assistance from OpenAI Codex.