You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python.defaultInterpreterPath command names like python3 are ignored with a warning #1884
Problem: Setting python.defaultInterpreterPath to a command name such as python3, or to python (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 on PATH, and the default python means "not set" (auto-select).
Environment: Windows 11, VS Code 1.140.0, extension main @ 52f6ace; python3 on PATH is the Python install manager alias for Python 3.14.8.
Before:
Steps to verify fix:
Check that python3 runs an interpreter in a terminal (where python3 / which python3).
Set "python.defaultInterpreterPath": "python3" in user settings and open a folder without a venv in a new window.
Open a .py file and verify no "could not be resolved" warning appears and the Python Environments log shows (source: defaultInterpreterPath).
Set the value to "python" and reload; verify no warning and the log shows (source: autoDiscovery). A workspace .venv is still preferred.
Set the value to "no-such-python" and reload; verify the warning still appears.
Set a relative path such as .venv/Scripts/python.exe (or .venv/bin/python) and verify it still resolves against the workspace folder.
Sharing media and context from merged PR #1888 for verification:
python.defaultInterpreterPath set to a command name such as python3 is now looked up on PATH instead of being joined to the workspace folder, and the default value python is 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.
findCommandOnPath: considers only absolute PATH entries and, on Windows, only .com/.exe files, 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 be stated, so which misses 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's DEFAULT_INTERPRETER_SETTING handling.
Not changed: absolute paths and ${workspaceFolder} values; values that cannot be resolved still warn.
Activity
fix: resolve command names in python.defaultInterpreterPath on PATH (F…
vs-code-engineering commentedon Oct 9, 2026
Sharing 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.${workspaceFolder}values; values that cannot be resolved still warn.Before / after
Fresh profile, folder without a venv, user setting
"python.defaultInterpreterPath": "python3"(python3onPATHis Python 3.14.8).Before
After
Validation
main@ 52f6ace,"python3"source: autoDiscovery"python3"source: defaultInterpreterPath, 3/3"python"main: ❌ warning; this PR: ✅ no warning,source: autoDiscoverynpm run lint,npm run compile-tests,npm run unittestinterpreterSelection.unit.test.ts, suite "bare command names")Created by Copilot
Source PR: #1888