Skip to content

python.defaultInterpreterPath command names like python3 are ignored with a warning #1884

Description

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:

Before: "Default interpreter path 'python3' could not be resolved" warning

Steps to verify fix:

  1. Check that python3 runs an interpreter in a terminal (where python3 / which python3).
  2. Set "python.defaultInterpreterPath": "python3" in user settings and open a folder without a venv in a new window.
  3. Open a .py file and verify no "could not be resolved" warning appears and the Python Environments log shows (source: defaultInterpreterPath).
  4. Set the value to "python" and reload; verify no warning and the log shows (source: autoDiscovery). A workspace .venv is still preferred.
  5. Set the value to "no-such-python" and reload; verify the warning still appears.
  6. Set a relative path such as .venv/Scripts/python.exe (or .venv/bin/python) and verify it still resolves against the workspace folder.

Found by Copilot

Activity

  1. added a commit that references this issue on Oct 9, 2026
    67eedfe
  2. vs-code-engineering commented on Oct 9, 2026

    @vs-code-engineering

    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.

    Before / after

    Fresh profile, folder without a venv, user setting "python.defaultInterpreterPath": "python3" (python3 on PATH is Python 3.14.8).

    Before

    Before: "could not be resolved" warning; the setting is ignored

    After

    After: no warning; python3 from PATH is used

    Validation

    Check Result
    UI scenario on main @ 52f6ace, "python3" ❌ warning; source: autoDiscovery
    UI scenario with this PR, "python3" ✅ no warning; source: defaultInterpreterPath, 3/3
    UI scenario, "python" main: ❌ warning; this PR: ✅ no warning, source: autoDiscovery
    npm 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentEnvironment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugtriage-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions