Skip to content

ms-python.vscode-python-envs universal extension missing platform-specific pet.exe binary on Windows #343

Description

@hexbay

Bug Description

The ms-python.vscode-python-envs and ms-python.python extensions installed by Windsurf are the universal variants, which do not include the platform-specific native binary pet.exe (Python Environment Tools locator). Without this binary, the Python Environments extension cannot resolve any manually-selected interpreter path, producing the error:

Selected file is not a valid Python interpreter: d:\.venv\Scripts\python.exe

This makes it impossible to select a virtual environment interpreter through the UI, blocking IntelliSense, linting, formatting, and debugging features.

Steps to Reproduce

  1. Install Windsurf on Windows (x64).
  2. Create a Python virtual environment (e.g. python -m venv .venv).
  3. Open a Python project in Windsurf.
  4. Ctrl+Shift+P -> Python: Select Interpreter -> Browse... -> select .venv\Scripts\python.exe.
  5. Error notification appears: "Selected file is not a valid Python interpreter: ..."

Expected Behavior

The interpreter should be recognized and selected successfully.

Actual Behavior

The extension fails to resolve the interpreter because the native PET (Python Environment Tools) binary is missing from the installed universal extension package.

Root Cause Analysis

The extension code (ms-python.vscode-python-envs) looks for pet.exe in two locations:

  1. <envs-extension-dir>/python-env-tools/bin/pet.exe
  2. <python-extension-dir>/python-env-tools/bin/pet.exe

Both Windsurf extensions are installed as universal (no targetPlatform), and neither contains the python-env-tools/bin/ directory:

C:\Users\<user>\.devin\extensions\ms-python.vscode-python-envs-1.36.0-universal\
  (no python-env-tools directory)

C:\Users\<user>\.devin\extensions\ms-python.python-2026.4.0-universal\
  (no python-env-tools directory)

Meanwhile, VS Code installs the win32-x64 platform-specific variants which do include the binary:

C:\Users\<user>\.vscode\extensions\ms-python.vscode-python-envs-1.36.0-win32-x64\
  python-env-tools\bin\pet.exe  (6,187,872 bytes)

C:\Users\<user>\.vscode\extensions\ms-python.python-2026.4.0-win32-x64\
  python-env-tools\bin\pet.exe  (5,592,128 bytes)

It appears Windsurf's extension marketplace/installer only fetches the universal package and does not install the platform-specific variant that contains the native pet.exe binary.

Workaround

Manually copy pet.exe from the VS Code win32-x64 extension directory to the Windsurf universal extension directory:

# For vscode-python-envs extension
Copy-Item "C:\Users\<user>\.vscode\extensions\ms-python.vscode-python-envs-1.36.0-win32-x64\python-env-tools\bin\pet.exe" `
  "C:\Users\<user>\.devin\extensions\ms-python.vscode-python-envs-1.36.0-universal\python-env-tools\bin\pet.exe"

# For ms-python.python extension (fallback location)
Copy-Item "C:\Users\<user>\.vscode\extensions\ms-python.python-2026.4.0-win32-x64\python-env-tools\bin\pet.exe" `
  "C:\Users\<user>\.devin\extensions\ms-python.python-2026.4.0-universal\python-env-tools\bin\pet.exe"

After copying and reloading the window, interpreter selection works correctly.

Environment

  • OS: Windows 11 (x64)
  • Windsurf Version: 3.8.20 (VS Code base 1.126.0, commit 2d9020110aa91587b3c3b0fcf7d1faaf601fc7b8)
  • Extension: ms-python.vscode-python-envs 1.36.0 (universal)
  • Extension: ms-python.python 2026.4.0 (universal)

Suggested Fix

Windsurf's extension installer should either:

  1. Install the platform-specific (win32-x64) variant of extensions that bundle native binaries, or
  2. Download the platform-specific native binary (pet.exe) as a post-install step for universal extensions that require it.

This likely affects other extensions that ship platform-specific native binaries via the universal package mechanism.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions