Skip to content

Cannot select venv environment #1718

Description

Environment data

Windows

Version: 1.133.0 (user setup)
Commit: a5b500951314efd502d07465bd138dfbd714a960
Date: 2026-08-11T22:14:08Z
Electron: 42.8.0
ElectronBuildId: 14845705
Chromium: 148.0.7778.280
Node.js: 24.18.0
V8: 14.8.178.38-electron.0
@github/copilot: 1.0.79-6
@github/copilot-sdk: 1.0.9
OS: a5b500951314efd502d07465bd138dfbd714a960

  • Python Environments extension version: 1.36.0
  • Python extension (ms-python.python) version: 1.36.0
  • VS Code version (Help → About): 1.1.33.0
  • OS and version: Windows 11
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13
  • Environment manager in use (venv / conda / pyenv / poetry / pipenv / system / uv / other): venv
  • Shell (bash / zsh / fish / pwsh / cmd / other): cmd
  • Remote / container scenario (none / WSL / SSH Remote / Dev Container / Codespaces): none
  • Workspace type (single folder / multi-root / mono-repo): single folder
  • Is this a regression? If yes, last known working extension version: unknown

Repro Steps

Try to select a venv environment outside of the workspace folder.

Expected behavior

The Python interpreter is selected

Actual behavior

Error message:

Selected file is not a valid Python interpreter: c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe

And it's falling back to the global Python installation instead.

Logs

Tried this several time, starting 09:49 is with trace level.

2026-08-18 09:51:37.254 [debug] Checking venv (ms-python.python:venv) for c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.255 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.255 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.287 [error] [pet] �[2m 784.057678400s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.057767700s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.288 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.288 [debug] Failed to resolve venv env "c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe": Error: Invalid python info: {"arch":null,"displayName":null,"error":null,"executable":"c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe","kind":"Venv","manager":null,"name":null,"prefix":"c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv","project":null,"symlinks":["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"],"version":null}
2026-08-18 09:51:37.290 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.290 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.322 [error] [pet] �[2m 784.092843600s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.092869400s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.323 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.325 [debug] Manager venv (ms-python.python:venv) cannot handle c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.325 [debug] Checking PyEnv (ms-python.python:pyenv) for c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.325 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.325 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.358 [error] [pet] �[2m 784.128602000s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.128635200s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.358 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.359 [debug] Checking Pipenv (ms-python.python:pipenv) for c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.360 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.361 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.423 [error] [pet] �[2m 784.193347300s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.193374500s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.427 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.428 [debug] Checking Poetry (ms-python.python:poetry) for c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.429 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.429 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.461 [error] [pet] �[2m 784.232215300s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.232244000s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.462 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.463 [debug] Checking Global (ms-python.python:system) for c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.464 [debug] Environment search directories: 2 paths
2026-08-18 09:51:37.464 [debug] [pet] configure: No changes detected, skipping configuration update.
2026-08-18 09:51:37.495 [error] [pet] �[2m 784.266021000s�[0m �[31mERROR�[0m �[2mpet_python_utils::env�[0m�[2m:�[0m Python Execution for "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe" produced an output "" without a separator
�[2m 784.266048100s�[0m �[31mERROR�[0m �[2mpet::jsonrpc�[0m�[2m:�[0m Failed to resolve env "c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe", returning discovered env PythonEnvironment { display_name: None, name: None, executable: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"), kind: Some(Venv), version: None, prefix: Some("c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv"), manager: None, project: None, arch: None, symlinks: Some(["c:\\svn\\modules\\reporting\\trunk\\lrs_lra\\venv\\Scripts\\python.exe"]), error: None }

2026-08-18 09:51:37.496 [info] Resolved Python Environment c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe
2026-08-18 09:51:37.497 [warning] Unable to handle c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe

Activity

  1. eleanorjboyd commented on Sep 23, 2026

    @eleanorjboyd
    Member

    🤖 Thanks for the detailed logs. PET discovers the path as a venv, but its attempt to run that python.exe to read the version and sys.prefix exits successfully with empty stdout (produced an output "" without a separator). The extension then gets an environment with no version and rejects it. The logs do not yet establish that being outside the workspace is the cause; they point first to an interpreter execution/probe problem.

    Could you run the following in cmd.exe (not the VS Code terminal) and share the exact output and exit code? Please replace the path if needed:

    "c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe" -c "import sys; print(sys.version); print(sys.prefix)"
    echo %ERRORLEVEL%

    Does that interpreter also produce no output when run directly? If so, please check whether it works after recreating the venv from a working Python installation. If it prints the expected version and prefix, could you also try selecting a fresh venv outside the workspace and report whether that works? That will help distinguish an interpreter-specific problem from PET executing Windows venvs outside the workspace incorrectly. Please include the pyvenv.cfg contents (redact any private paths) and the version of the base Python installation used to create this venv.

  2. hvbtup commented on Sep 28, 2026

    @hvbtup
    Author
    Microsoft Windows [Version 10.0.26200.9168]
    (c) Microsoft Corporation. Alle Rechte vorbehalten.
    
    C:\xxx>"c:\svn\modules\reporting\trunk\lrs_lra\venv\Scripts\python.exe" -c "import sys; print(sys.version); print(sys.prefix)"
    3.13.10 (tags/v3.13.10:4fd8843, Dec  2 2025, 15:08:18) [MSC v.1944 64 bit (AMD64)]
    c:\svn\modules\reporting\trunk\lrs_lra\venv
    
    C:\xxx>echo %ERRORLEVEL%
    0
    

    ATM I cannot reproduce the behaviour with VSC Version: 1.136.1 (user setup)
    Commit: a44adf7f53e00964ab890f9f8758a334f1fc15bc
    Date: 2026-09-03T05:06:41Z
    Electron: 42.10.0
    ElectronBuildId: 15109253
    Chromium: 148.0.7778.280
    Node.js: 24.18.1
    V8: 14.8.178.38-electron.0
    @github/copilot: 1.0.81-0
    @github/copilot-sdk: 1.0.11
    OS: Windows_NT x64 10.0.26200

  3. eleanorjboyd commented on Sep 30, 2026

    @eleanorjboyd
    Member

    Thanks for checking and confirming that you can no longer reproduce this on VS Code 1.136.1. Your direct interpreter check also returns the expected version and environment prefix.

    We’ll close this as no longer reproducible. The original logs show that the interpreter probe returned empty output, but we haven’t established why or whether the environment’s location outside the workspace was relevant.

    If it recurs, please reopen with fresh Python Environments trace logs and the installed Python and Python Environments extension versions, and repeat the direct interpreter check while the failure is occurring. Thank you for getting back to us!!

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 buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions