Repository navigation
Interpreter selection for Python files outside the workspace reverts to system Python (1.38.0, Remote SSH) #1931
Description
Environment data
- Python Environments extension: 1.38.0
- Python extension (
ms-python.python): 2026.8.0 (linux-x64), confirmed in the active Python output log - Pylance: 2026.4.1
- VS Code remote server: 1.141.0 (from the running server installation; local client Help > About was not captured)
- Remote OS: Ubuntu 24.04.4 LTS, Linux x86_64, kernel 6.8.0-142-generic
- Selected Python: 3.12.3, a shared virtual environment stored outside the repository and managed with uv
- Shell: bash
- Remote scenario: SSH Remote
- Workspace: single folder
- Regression: unknown; no known-good version established
Repro Steps
Observed in an existing workspace; not yet tested in a clean profile.
- Open a single-folder workspace containing a Python project (in this case, TileLang tutorials).
- Select a working virtual environment for that workspace. Python files inside the workspace use that environment.
- Open a Python source file in a separate repository outside the workspace folder. In this case it is the dependency's source,
tilelang/tilelang/backend/module.py, in a sibling TileLang checkout. - With that external file active, click the Python interpreter indicator in the bottom-right status bar and select the intended virtual environment.
- Observe that the status bar returns to
/usr/bin/python3instead of retaining the selected environment for the external file.
Simplified directory layout (paths anonymized):
<home>/repos/tutorials/ # opened workspace
<home>/repos/tilelang/tilelang/backend/module.py # external file
<home>/uv-envs/tilelang-env/bin/python # desired interpreter
Python Environments integration was active at the time of observation, confirmed by the Python output log. The remote settings did not explicitly set python.useEnvironmentsExtension. The relevant explicit setting was:
{
"python.terminal.activateEnvironment": true
}Expected behavior
An explicit interpreter selection while an external Python file is active should be retained for that file or its applicable scope. If the picker instead updates only the workspace's environment, the UI should clearly identify that scope and provide a way to select an interpreter for the external file.
This report does not assume that every external file must automatically inherit the workspace interpreter. The problem is that the explicit selection appears ineffective and the status bar returns to the system interpreter.
Actual behavior
Workspace files use the intended virtual environment, but the external file displays /usr/bin/python3. Selecting the intended environment from the status bar does not retain it for the external file.
Logs
Relevant startup excerpts below are anonymized. They show separate workspace and global selections. They do not capture the picker interaction or prove the cause of the reported reversion; no trace-level reproduction log is available yet.
Python output:
2026-10-13 09:59:54.658 [info] Environment discovery is managed by the Python Environments extension (ms-python.vscode-python-envs). Check the "Python Environments" output channel for environment-specific logs.
2026-10-13 09:59:58.238 [info] Active interpreter [<home>/repos/tutorials]: <home>/uv-envs/tilelang-env/bin/python
Python Environments output (environment display name anonymized):
2026-10-13 09:59:54.969 [info] Python API: Changed environment from undefined to tilelang-env (3.12.3) for: <home>/repos/tutorials
2026-10-13 09:59:54.970 [info] [interpreterSelection] tutorials: tilelang-env (3.12.3) (source: autoDiscovery)
2026-10-13 09:59:54.970 [info] [interpreterSelection] Workspace env resolved, deferring global scope to background
2026-10-13 09:59:55.153 [info] Python API: Changed environment from undefined to Python 3.12.3 for: global
2026-10-13 09:59:55.153 [info] [interpreterSelection] global: Python 3.12.3 (source: autoDiscovery)
Additional context
Related closed reports:
- Workspace virtual environment interpreter cannot be used for files outside workspace #1099 — Workspace virtual environment interpreter cannot be used for files outside workspace.
- Projects selector for status bar environment selector no longer allows select for current script nor does its job properly. #1385 — Status bar project selector / per-file interpreter selection. Later comments report that the proposed "Set for current file" option was still unavailable.
I am reporting the current observation on Python Environments 1.38.0 because those reports are closed. It is not yet clear whether this is the same underlying bug, a regression, or a scope-selection/UI problem.
A proposed workaround is to set "python.useEnvironmentsExtension": false and reload VS Code to use the Python extension's original interpreter selection. This setting has been applied locally, but its effectiveness has not yet been verified after reload.
The practical use case is inspecting a dependency's source checkout from a tutorials workspace while using the same environment. Adding every dependency checkout to the workspace should not be required just to make an explicit interpreter selection effective.
Activity