问题
I am trying to use different versions of Python on my Windows pc and I'm getting this error when using pip:
Fatal error in launcher: Unable to create process using '"c:\users\ryanm\appdata\local\programs\python\python38\python.exe" "C:\Python38\Scripts\pip.exe" ': The system cannot find the file specified.
I understand that this might mean there's two PATH to each of those locations so it's confused, but c:\users\ryanm\appdata\local\programs\python\python38\python.exe doesn't even exist on my computer nor in my PATH.
Output of where python is:
C:\Python38\python.exe`
Here is the PATH in readable format
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\nodejs\
C:\Program Files\Git\cmd
C:\Program Files\wkhtmltopdf
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
C:\Python38\Scripts
C:\Python38\
"C:\Users\ryanm\AppData\Local\Microsoft\WindowsApps
C:\bin"
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1\bin
C:\Program Files (x86)\Nmap
C:\Users\ryanm\AppData\Local\Microsoft\WindowsApps
C:\Users\ryanm\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\ryanm\AppData\Roaming\npm
C:\Users\ryanm\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
C:\Program Files\wkhtmltopdf
C:\ProgramData\ryanm\atom\bin
C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin
C:\Program Files\MongoDB\Server\4.2\bin
回答1:
it seems like python team may have implemented some secure measures.
The new method now is just to prefix python -m before your commands.
Let's say you are trying to install pygame (any package) with pip. For that, you'll use
python -m pip install pygame //Or any package name
Also, upgrading pip and all other commands will also use the same command structure:
pythom -m pip install --upgrade pip
来源:https://stackoverflow.com/questions/61419086/fatal-error-in-launcher-unable-to-create-process-using-file-path1-file-path2