Repository navigation
python.defaultInterpreterPath command names like python3 are ignored with a warning #1884
Copy link
Copy link
Closed
Labels
area-environmentEnvironment, interpreter related issues.Environment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugtriage-needed
Description
Activity
- addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugarea-environmentEnvironment, interpreter related issues.Environment, interpreter related issues.
on Oct 5, 2026 - added a commit that references this issue
on Oct 9, 2026 vs-code-engineering commented
on Oct 9, 2026 More actionsSharing media and context from merged PR #1888 for verification:
python.defaultInterpreterPathset to a command name such aspython3is now looked up onPATHinstead of being joined to the workspace folder, and the default valuepythonis treated as not configured, as in the Python extension. Previously both showed "Default interpreter path '…' could not be resolved" at startup and the setting was ignored.toAbsoluteInterpreterPath: a value without a path separator is looked up onPATHfirst; other relative paths still resolve against the workspace folder (Fix ${workspaceFolder} resolution and relative path handling for defaultInterpreterPath #1603).findCommandOnPath: considers only absolutePATHentries and, on Windows, only.com/.exefiles, since batch-file shims (for example pyenv-win's) cannot be started without a shell. It accepts App Execution Aliases (WindowsApps\python3.exe), which exist but cannot bestated, sowhichmisses them.python, the setting's default, skips priority 3 without a warning, so auto-discovery still prefers a workspace.venv. This matches the Python extension'sDEFAULT_INTERPRETER_SETTINGhandling.- Not changed: absolute paths and
${workspaceFolder}values; values that cannot be resolved still warn. - When the command resolves to a global interpreter that is not the newest one installed, the status bar and Run use it only once fix: use python.defaultInterpreterPath when it is not a venv (Fixes #1885) #1887 is merged (Non-venv python.defaultInterpreterPath is logged as selected but the newest Python is used #1885).
Before / after
Fresh profile, folder without a venv, user setting
"python.defaultInterpreterPath": "python3"(python3onPATHis Python 3.14.8).Before
After
Validation
Check Result UI scenario on main@ 52f6ace,"python3"❌ warning; source: autoDiscoveryUI scenario with this PR, "python3"✅ no warning; source: defaultInterpreterPath, 3/3UI scenario, "python"main: ❌ warning; this PR: ✅ no warning,source: autoDiscoverynpm run lint,npm run compile-tests,npm run unittest✅ 2546 passing (5 new tests in interpreterSelection.unit.test.ts, suite "bare command names")
Created by Copilot
Source PR: #1888
Metadata
Metadata
Assignees
Labels
area-environmentEnvironment, interpreter related issues.Environment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugtriage-needed


Problem: Setting
python.defaultInterpreterPathto a command name such aspython3, or topython(the setting's default value), shows "Default interpreter path 'python3' could not be resolved" at every startup, and the setting is ignored. Since #1603, relative values are resolved against the workspace folder, so a command name becomes<workspace>/python3, which does not exist. In the Python extension, a command name means the interpreter onPATH, and the defaultpythonmeans "not set" (auto-select).Environment: Windows 11, VS Code 1.140.0, extension
main@ 52f6ace;python3onPATHis the Python install manager alias for Python 3.14.8.Before:
Steps to verify fix:
python3runs an interpreter in a terminal (where python3/which python3)."python.defaultInterpreterPath": "python3"in user settings and open a folder without a venv in a new window..pyfile and verify no "could not be resolved" warning appears and the Python Environments log shows(source: defaultInterpreterPath)."python"and reload; verify no warning and the log shows(source: autoDiscovery). A workspace.venvis still preferred."no-such-python"and reload; verify the warning still appears..venv/Scripts/python.exe(or.venv/bin/python) and verify it still resolves against the workspace folder.Found by Copilot