A vscode extension needs to use py launcher. I installed Python via scoop and it works:
PS C:\Users\W> python --version
Python 3.12.1
When checking for py, it is where it is expected to be:
PS C:\Users\W> Get-Command py
CommandType Name Version Source
----------- ---- ------- ------
Application py.exe 3.12.1150… C:\Users\W\scoop\apps\python\current\py.exe
So far so good. Now when I actually want to launch py I get
PS C:\Users\W> py
Unable to create process using 'C:\Users\W\scoop\apps\python\3.11.3\python.exe': The system cannot find the file specified.
py seems to point to an old version that I may have had in the past.
I uninstalled Python, checked that py is now unknown, and reinstalled it afterwards. The effect is the same - this information must have been saved somewhere, and worse, this is the only Python installation py knows about:
PS C:\Users\W> py --list
-V:3.11 * Python 3.11 (64-bit)
3.11 is nowhere to be found and py.exe directly comes from the 3.12 installation
PS C:\Users\W> ls C:\Users\W\scoop\apps\python
Directory: C:\Users\W\scoop\apps\python
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 21/12/2023 17:35 3.12.1
l-r-- 21/12/2023 17:35 current -> C:\Users\W\scoop\apps\python\3.12.1
I am now at the end of my journey to try to understand where th eproblem is, thus my question: how to reset the py database of installed Python versions?
I searched the Registry for
3.11.3, found it atHKEY_USERS\<my user UID>\Software\Python\PythonCore\3.11.3and removed completely.pythen could not find any installation.I then uninstalled/installed Python (via
scoop) and still no available installation according topy.The
scoopinstall provides at the end a.regfile that populates the Registry path above (somehow it did not propose it with my previous installations).Adding the Registry entry finally fixed the issue
I belive that this issue will be specific to
scoopinstallations, I will update the tags.