I'm trying to run a pip installation on my Windows machine using the command:
pip install -r requirements.txt
But when I try to execute that command, I get the following error:
Fatal error in launcher: Unable to create process using '"C:\Program Files\Inkscape\bin\python.exe" "C:\Users\[my user]\.local\bin\pip.exe" install -r requirements.txt': The system cannot find the file specified.
The evident thing here is that it's looking for the python.exe file in an incorrect folder.
This folder used to be in the PATH environment variable for my user, and I've since removed it. I've also reinstalled Python without that folder in the PATH variable, but even then I still get that error. Is there a manual way to tell the system specifically that python.exe is in the \AppData\Local\Programs\Python\Python312\ path and not the one it assumes it is in?
I also followed the instructions in the best answer to this question made prior in the site.
EDIT: using where python yields the following:
C:\Users\[my user]\AppData\Local\Microsoft\WindowsApps\python.exe
EDIT 2: using echo %PATH% does show the folders that contain python.exe and pip.exe.
By the way, there is in fact a pip.exe in the path the error provides.
The
pip.exefile consists of a simple launcher stub executable, followed by a shebang line containing the path to the actual launcher (to the wrongpython.exein this case) and finally a ZIP-file containing a python script which should be executed by the python executable.Details about the launcher stub can be found at https://bitbucket.org/vinay.sajip/simple_launcher/src/master/
If the shebang line contains the absolute path (usually this is the case and seems the case here), playing around with the
PATHenvironment variable won't do anything as long as the samepip.exeis launched.Solution is to find the
pip.exewhich was installed with your Python version (should be in a directoryScriptsbelow thepython.exe). You can copy thispip.exeand replace theC:\Users\[my user]\.local\bin\pip.exewith it.The slightly more complicated option would be to modify the
pip.exewith a hex editor to set the right path.