Skip to content

a problem on vscode can't find python interpreter #25769

@EstrangedZ

Description

@EstrangedZ

Type: Bug

Behaviour

The Python extension fails to discover any interpreters (including the local venv) and the "Run Python File" button becomes unresponsive on the second and subsequent launches of VS Code.

Crucially, the extension only works during the very first launch after manually deleting the VS Code cache folders. Once VS Code is closed and reopened for a second time, the "Select Interpreter" command (Ctrl+Shift+P) yields no results, and the extension appears to hang indefinitely during the environment discovery phase.

Temporary Workaround:
Setting "python.experiments.enabled": false and "python.locator": "js" in settings.json resolves the issue, but i dont know why.

Steps to reproduce:

  1. System Setup: Fresh install of Windows 10 Pro 22H2.
  2. Tools: Install Git (in C:\Program Files\Git) and pyenv-win (in C:\Tools\pyenv).
  3. Project Setup: Use pyenv-win to create a virtual environment (venv) with Python 3.11.9 in a project root. Create a test1.py file with print("hello world") at the same level as venv.
  4. VS Code: Install VS Code System x64 (version 1.109.0) with only 4 extensions: Pylance (2025.10.4), Python (2026.0.0), Python Debugger (2025.18.0), and Python Environments (1.16.0).
  5. Initial Failure: Open the project folder. Click "Run Python File" (no response) or attempt to "Select Interpreter" (no results/unresponsive).
  6. Clear Cache: Close VS Code. Go to %AppData%\Code and delete the following five folders: Cache, CachedConfigurations, CachedData, CachedExtensionVSIXs, and CachedProfilesData.
  7. First Launch (Success): Reopen VS Code. The extension now successfully discovers the Python interpreter and the venv.
  8. Second Launch (Persistent Failure): Close and restart VS Code again without clearing the cache. The extension returns to the unresponsive state (no interpreters found, "Run" button fails).

Diagnostic data

When this issue appears,the output of python shows:

2026-02-06 21:18:46.716 [info] Native locator: Refresh started
2026-02-06 21:18:46.716 [info] Skipping ActivatedEnv Detection: process.env.VSCODE_CLI !== '1'
2026-02-06 21:18:46.724 [info] > C:\Tools\pyenv\pyenv-win\bin\pyenv which python
2026-02-06 21:18:46.724 [info] cwd: .

and meanwhile the python locator shows:
2026-02-06 21:18:46.716 [info] Starting Python Locator c:\Users\myadmin.vscode\extensions\ms-python.python-2026.0.0-win32-x64\python-env-tools\bin\pet.exe server

I hope these can help you find the solution.

Extension version: 2026.0.0
VS Code version: Code 1.109.0 (bdd88df003631aaa0bcbe057cb0a940b80a476fa, 2026-02-04T02:01:38.288Z)
OS version: Windows_NT x64 10.0.19045
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

experiments
• enabled: false

Installed Extensions
Extension Name Extension Id Version
copilot-chat Git 0.37.1
debugpy ms- 2025.18.0
js-debug ms- 1.105.0
js-debug-companion ms- 1.1.3
python ms- 2026.0.0
vscode-js-profile-table ms- 1.0.10
vscode-pylance ms- 2025.10.4
vscode-python-envs ms- 1.16.0
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i9-13905H (20 x 2995)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x8086, DEVICE=0xa7a0 [Intel(R) Iris(R) Xe Graphics], DRIVER_VENDOR=Intel, DRIVER_VERSION=31.0.101.4032 ACTIVE
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.3636
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.75GB (24.51GB free)
Process Argv --crash-reporter-id 96c84dc0-6714-454b-864f-41e36f6752ca
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
6abeh943:31336334
editstats-enabled:31346257
cloudbuttont:31379625
aihoversummaries_f:31453033
3efgi100_wstrepl:31403338
use-responses-api:31390855
je187915:31401257
ec5jj548:31422691
cmp-ext-treat:31426748
cp_cls_t_966_ss:31454198
a9239246:31445437
c0683394:31458171
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-off:31446584
a5gib710:31434435
2984c849_gpt52_codex:31457542
rename_enabled:31436409
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_c:31457102
722j7530_gpt_5_2_codex:31458091
h0hdh950:31428394
preserve_tokens:31444547
cp_cls_c_1081:31454833
copilot-nes-oct-trt:31432596
ia-use-proxy-models-svc:31452481
nes-slash-models-on:31441832
core-renderer-profiling-on:31440367
nes-set-to-on:31441941
a43f0574:31442827
c0ci8992_validated:31449878
nes-conv-1-2:31447851
showstats:31457174
notips:31457203
reg-2ge67640:31455970
nes-extended-on:31455476
anthropic_tst_c:31457103
chat:31457767

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions