You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VSCode does not execute Python files after clean Windows reinstall (process hangs and exits silently) #25711
I previously selected the second option, where I chose the location of python.exe on my computer, and now I have the third option, which is what I meant by “Manually select the Python interpreter located at: C:\Users...\AppData\Local\Programs\Python\Python312\python.exe.” I disabled all extensions and enabled only the Python one, but it keeps loading indefinitely, as shown in the following image.
Once I hit the first one, it sent me to the console, and this is what I saw on the console: """
PS F:\Proyectos\Roblox> & c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbose
PS F:\Proyectos\Roblox>
""", it seems that nothing is running.
I clicked on the second one and it asked me to give it the path to python.exe on my computer. Once I gave it the path, the console displayed: """
PS F:\Proyectos\Roblox> & c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe resolve C:\Users\julia\AppData\Local\Python\pythoncore-3.14-64\python.exe
PS F:\Proyectos\Roblox>
""".
I went to the exit and these are the exits I see:
Python
"""
2026-01-07 11:09:34.463 [info] El experimento "pythonSurveyNotification" está activo
2026-01-07 11:09:34.561 [info] Native locator: Refresh started
2026-01-07 11:09:34.612 [info] > pyenv which python
2026-01-07 11:09:34.612 [info] cwd: .
"""
you should be able to run c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbose from your terminal for the same results. If you could try that and get the logs that would be great- sorry!
the process exits immediately with no output at all (no stdout, no stderr, no logs), even with --verbose.
This matches the behavior seen when running PET from VS Code:
pet.exe find --verbose is invoked (confirmed in the Python Environments logs),
but it never produces output or completes environment resolution.
This also explains why:
Python scripts hang when run via VS Code (Run / F5),
no errors are shown,
but running python test.py directly from the integrated terminal works correctly.
Since pet.exe shows the same silent behavior when executed independently of VS Code, this seems to indicate an issue with PET itself (or its interaction with the system after a clean Windows install), rather than a VS Code UI or configuration problem.
Please let me know if you’d like me to collect additional diagnostics or try a specific PET build or flag.
After the clean Windows reinstall, the Microsoft Visual C++ Redistributable (VC++ 14.x / 2015–2022, x64) was not installed on the system. As a result, pet.exe failed to start due to a missing VCRUNTIME140.dll.
Because pet.exe could not launch, it exited immediately and silently (no stdout/stderr). This caused:
Python execution via VS Code (Run / F5) to hang indefinitely
No visible errors in VS Code
Normal execution when running python script.py directly from the terminal (since PET is not involved)
Once the Visual C++ Redistributable 2015–2022 (x64) was installed and the system rebooted:
pet.exe find --verbose runs correctly
Python execution via VS Code works as expected again
This appears to be a dependency assumption issue after a clean Windows install, where the required VC++ runtime is not present by default.
Thank you all for your help. Without your assistance, I would not have been able to fix the bug that was preventing me from working comfortably. I hope this also helps in future cases!
Activity
eleanorjboyd commentedon Jan 5, 2026
How do you do: "Manually select the Python interpreter located at: C:\Users...\AppData\Local\Programs\Python\Python312\python.exe"
eleanorjboyd commentedon Jan 5, 2026
additionally if you could check your logs for the python extension and include those that would be great!
jmpcm commentedon Jan 6, 2026
I'm having the same problem, but in Linux. I don't see any information in the logs window.
Not sure how this is related, but setting
"python.useEnvironmentsExtension" : truesolved the issue. See issue #25694.Julian7668 commentedon Jan 6, 2026
I previously selected the second option, where I chose the location of python.exe on my computer, and now I have the third option, which is what I meant by “Manually select the Python interpreter located at: C:\Users...\AppData\Local\Programs\Python\Python312\python.exe.” I disabled all extensions and enabled only the Python one, but it keeps loading indefinitely, as shown in the following image.
eleanorjboyd commentedon Jan 7, 2026
Could you please run the Python Environment Tool and share the output? Here’s how:
This will show us which environments VS Code detected and how they were resolved and this might show us why they aren't finishing in the UI here
Julian7668 commentedon Jan 7, 2026
I got to step 3 and was given these two options:

Once I hit the first one, it sent me to the console, and this is what I saw on the console: """
PS F:\Proyectos\Roblox> & c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbose
PS F:\Proyectos\Roblox>
""", it seems that nothing is running.
I clicked on the second one and it asked me to give it the path to python.exe on my computer. Once I gave it the path, the console displayed: """
PS F:\Proyectos\Roblox> & c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe resolve C:\Users\julia\AppData\Local\Python\pythoncore-3.14-64\python.exe
PS F:\Proyectos\Roblox>
""".
I went to the exit and these are the exits I see:
Python

"""
2026-01-07 11:09:34.463 [info] El experimento "pythonSurveyNotification" está activo
2026-01-07 11:09:34.561 [info] Native locator: Refresh started
2026-01-07 11:09:34.612 [info] > pyenv which python
2026-01-07 11:09:34.612 [info] cwd: .
"""
Python Debugger

Python Environments
"""
2026-01-07 11:09:34.464 [info]
=== Python Envs Configuration Levels ===
2026-01-07 11:09:34.464 [info] {
"section": "Python Envs Configuration Levels",
"defaultEnvManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "undefined",
"globalValue": "undefined",
"defaultValue": "ms-python.python:venv"
},
"defaultPackageManager": {
"workspaceFolderValue": "undefined",
"workspaceValue": "undefined",
"globalValue": "undefined",
"defaultValue": "ms-python.python:pip"
}
}
2026-01-07 11:09:34.464 [info] [pet] Starting Python Locator c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe server
2026-01-07 11:09:34.583 [info] getAllExtraSearchPaths completed. Total unique search directories: 0 Paths: []
2026-01-07 11:09:34.585 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["f:\Proyectos\Roblox"],"environmentDirectories":[],"poetryExecutable":"poetry","cacheDirectory":"c:\Users\julia\AppData\Roaming\Code\User\globalStorage\ms-python.vscode-python-envs\pythonLocator"}
2026-01-07 11:10:36.581 [info] Running PET find command: c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbose
2026-01-07 11:17:15.108 [info] Running PET find command: c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbose
2026-01-07 11:20:42.259 [info] Running PET resolve command: c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe resolve "C:\Users\julia\AppData\Local\Python\pythoncore-3.14-64\python.exe"
"""
eleanorjboyd commentedon Jan 8, 2026
you should be able to run
c:\Users\julia.vscode\extensions\ms-python.vscode-python-envs-1.15.13521015-win32-x64\python-env-tools\bin\pet.exe find --verbosefrom your terminal for the same results. If you could try that and get the logs that would be great- sorry!Julian7668 commentedon Jan 8, 2026
I ran the Python Environment Tool (
pet.exe) directly from my system terminal, outside of VS Code, using the exact path you provided.I verified that:
ms-python.vscode-python-envs-1.15.13521015-win32-x64exists.python-env-tools/bin/pet.exeexists and is executable.When running the following command from PowerShell:
the process exits immediately with no output at all (no stdout, no stderr, no logs), even with
--verbose.This matches the behavior seen when running PET from VS Code:
pet.exe find --verboseis invoked (confirmed in the Python Environments logs),This also explains why:
python test.pydirectly from the integrated terminal works correctly.Since
pet.exeshows the same silent behavior when executed independently of VS Code, this seems to indicate an issue with PET itself (or its interaction with the system after a clean Windows install), rather than a VS Code UI or configuration problem.Please let me know if you’d like me to collect additional diagnostics or try a specific PET build or flag.
eleanorjboyd commentedon Jan 9, 2026
Don Jayamanne (@DonJayamanne) any thoughts here?
DonJayamanne commentedon Jan 13, 2026
Can you try running this in command prompt.
Its also possible you have some anti virus software or the like that might be blocking this executable.
Julian7668 commentedon Jan 15, 2026
Root cause identified and resolved.
After the clean Windows reinstall, the Microsoft Visual C++ Redistributable (VC++ 14.x / 2015–2022, x64) was not installed on the system. As a result,
pet.exefailed to start due to a missingVCRUNTIME140.dll.Because
pet.execould not launch, it exited immediately and silently (no stdout/stderr). This caused:python script.pydirectly from the terminal (since PET is not involved)Once the Visual C++ Redistributable 2015–2022 (x64) was installed and the system rebooted:
pet.exe find --verboseruns correctlyThis appears to be a dependency assumption issue after a clean Windows install, where the required VC++ runtime is not present by default.
Thank you all for your help. Without your assistance, I would not have been able to fix the bug that was preventing me from working comfortably. I hope this also helps in future cases!