Repository navigation
Python extension fails to select Conda/Anaconda environment ("Invalid Python interpreter" & t.runInTerminal error) #26087
Description
Type: Bug
Behaviour
Selecting any Anaconda/Conda environment (whether base or a custom environment) via Python: Select Interpreter fails.
VS Code displays:
"An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging."
The status bar remains yellow ("No Python environment is set for this resource"), and execution fails due to an internal t.runInTerminal error.
Steps to Reproduce
- Install Anaconda on Windows 11 under
C:\Users\<username>\anaconda3. - Open VS Code and open a
.pyfile. - Open Command Palette (
Ctrl+Shift+P) ->Python: Select Interpreter. - Select either the
baseor custom Conda environment.
Expected Result
VS Code binds the selected Python interpreter to the current workspace.
Actual Result
Selection is rejected with the "Invalid Python interpreter" error, and the terminal log shows a t.runInTerminal argument failure.
Diagnostics Verified
- Binary execution via external PowerShell (
& "C:\Users\<username>\anaconda3\envs\CondaEnv\python.exe" --version) succeeds (Python 3.13.14). - Running VS Code as Administrator does not resolve the issue.
- Cleared
%APPDATA%\Code\User\globalStorageandworkspaceStorage. - Switched default terminal profile to PowerShell and set
python.terminal.activateEnvironment: false.
Output Log (Python Channel)
2026-08-01 20:16:07.284 [info] Native locator: Refresh started
2026-08-01 20:16:07.944 [info] Native locator: Refresh finished in 660 ms
2026-08-01 20:16:09.006 [info] Starting Pylance language server.
2026-08-01 20:16:09.022 [info] > python -c "import sys;print(sys.executable)"
2026-08-01 20:16:11.692 [info] Active interpreter [global]: c:\Users\pabt1\anaconda3\envs\CondaEnv\python.exe
2026-08-01 20:16:11.842 [info] Active interpreter [global]: python
2026-08-01 20:21:35.996 [error] Failed to execute file in terminal [Error: Invalid arguments to run in terminal
at t.runInTerminal (c:\Users\pabt1\.vscode\extensions\ms-python.python-2026.0.0-win32-x64\out\client\extension.js:2:457813)
at async P.executeUsingExtension (c:\Users\pabt1\.vscode\extensions\ms-python.python-2026.0.0-win32-x64\out\client\extension.js:2:878460)
at async c:\Users\pabt1\.vscode\extensions\ms-python.python-2026.0.0-win32-x64\out\client\extension.js:2:875685
at async jg._executeContributedCommand (file:///c:/Users/pabt1/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:535:48807)]
2026-08-01 20:21:39.496 [info] Active interpreter [global]: c:\Users\pabt1\anaconda3\envs\CondaEnv\python.exe
2026-08-01 20:21:39.592 [info] Active interpreter [global]: python
Extension version: 2026.0.0
VS Code version: Code 1.131.0 (e4c7e7b1d6d060162f4aa7f8225271b67ce1df75, 2026-07-28T10:51:25Z)
OS version: Windows_NT x64 10.0.26200
Modes:
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|AMD Ryzen 7 5800H with Radeon Graphics (16 x 3194)|
|GPU Status|2d_canvas: enabled<br>GPU0: VENDOR= 0x10de, DEVICE=0x2560 [NVIDIA GeForce RTX 3060 Laptop GPU], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1088 *ACTIVE*<br>GPU1: VENDOR= 0x1002, DEVICE=0x1638 [AMD Radeon(TM) Graphics], DRIVER_VERSION=31.0.12044.3<br>GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8875<br>Machine model name: <br>Machine model version: <br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>trees_in_viz: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|13.86GB (2.70GB free)|
|Process Argv|--crash-reporter-id 4d8622fe-b93c-46a6-ba34-3a5b0542e64b|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>A/B Experiments</summary>
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
4f60g487:31327383
envsactivate1:31551504
gh487529:31544284
cloudbuttont:31379625
42190218_ostrepl:31403339
ddidtcf:31399634
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
8hhj4413:31478653
cp_cls_t_1081:31454832
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
46204921:31447328
control_6dc23131:31555649
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
89g7j272:31518289
7e187181:31503455
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
ddid_c:31478207
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
jh5f2457_c:31540921
41836166:31537719
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
d7b18187:31526828
nes-curr-leftover-1500:31538366
ahp-both-windows:31556933
h561g132:31533256
session_8:31532895
ihg5j128:31534457
f412h606:31551416
7g2b5551:31542111
max-result-100:31551154
nes-ex-cf-euporie-03:31542868
5fe6f778:31554331
allow-none:31555437
6i51c363:31551401
c7c27ce7:31554789
nes-gb3-nf-6k:31554346
8hc4g144:31558143
0dg73464:31554319
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
session-mark-done:31558131
</details>
<!-- generated by issue reporter -->
Activity
abtxph01 commentedon Aug 1, 2026
I reported this initially on StackOverflow. See this post here with the steps I tried to solve it:
https://stackoverflow.com/questions/79989245/vs-code-python-extension-fails-to-set-anaconda-base-interpreter-invalid-python
abtxph01 commentedon Aug 1, 2026
Hi Eleanor Boyd (@eleanorjboyd),
Sorry for opening this in
vscode-pythonagain—I saw your feedback on my Q&A for this issue too late!Here are the requested diagnostics and additional findings for this bug:
v1.36.0Downloadsfolder): Selection works fine and code executes without issues..pyfile standalone (no-folder window): Selection fails with "An Invalid Python interpreter is selected..." and the status bar remains yellow with "Select Python Interpreter".PET Output (
pet find --verbose):PS C:\Users<username>> & c:\Users<username>.vscode\extensions\ms-python.vscode-python-envs-1.36.0-win32-x64\python-env-tools\bin\pet.exe find --verbose
0.003151400s WARN pet_windows_registry::environments: Failed to open HKLM\Software\Python, Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
0.004807500s WARN pet_conda::package: Unable to find conda package Conda in "C:\Users\\anaconda3", trying slower approach
0.010509600s WARN pet_conda::package: Unable to find conda package Python in "C:\Users\\anaconda3", trying slower approach
0.012874500s WARN pet_conda::package: Unable to find conda package Conda in "C:\Users\\anaconda3", trying slower approach
0.013128900s WARN pet_windows_registry::environments: Failed to open HKLM\Software\Python, Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
0.014925300s WARN pet_conda::package: Unable to find conda package Conda in "C:\Users\\anaconda3", trying slower approach
0.081026100s WARN pet_conda::package: Unable to find conda package Python in "C:\Users\\anaconda3", trying slower approach
Breakdown by each locator:
Conda : 79.3494ms
Hatch : 708.4µs
PipEnv : 747.5µs
Pixi : 200ns
Poetry : 1.5536ms
PyEnv : 708.8µs
Uv : 293.1µs
Venv : 100ns
VirtualEnv : 1.4µs
VirtualEnvWrapper : 100ns
WinPython : 86.8µs
WindowsRegistry : 13.6803ms
WindowsStore : 270.1µs
Breakdown for finding Environments:
GlobalVirtualEnvs : 5.7777ms
Locators : 79.9531ms
Path : 6.5126ms
Workspaces : 21.6089ms
Environment Paths:
Conda:
Managers:
Conda : 1
Environments (2):
Conda : 2
Completed in 84ms
hugo-jz commentedon Aug 14, 2026
I have the same exact issue after a fresh Anaconda and VS Code install. Is there a fix/workaround yet?
Matsunhong commentedon Aug 19, 2026
I encountered a very similar “Invalid Python interpreter” issue on Windows, but in my case the root cause turned out to be broken ACL inheritance in an All Users Anaconda installation under
C:\ProgramData\Anaconda3.Environment
1.133.0(User Setup)2026.4.0and2025.16.0C:\ProgramData\Anaconda3C:\Users\<username>\.conda\envsSymptoms
python.exefiles themselves worked correctly when launched directly.That last point led me to check Conda's filesystem permissions. From a normal (non-elevated) Command Prompt:
lraugustin commentedon Aug 25, 2026
Exactly the same issue here, looking forward to a solution