Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error in launcher: Unable to create process using "file path1" file path2" : The system cannot find the file specified

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\mypc\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\mypc\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\mypc\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\mypc\AppData\Local\Microsoft\WindowsApps
C:\Users\mypc\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\mypc\AppData\Roaming\npm
C:\Users\mypc\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
C:\Program Files\wkhtmltopdf
C:\ProgramData\mypc\atom\bin
C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.3\bin
C:\Program Files\MongoDB\Server\4.2\bin
like image 827
RyM Avatar asked Dec 13 '22 08:12

RyM


2 Answers

it seems like python team may have implemented some security 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:

python -m pip install --upgrade pip
like image 64
SowingFiber Avatar answered Feb 16 '23 14:02

SowingFiber


When you go to Environment Variables there's 2 PATH's. One at the top and one under System variables. Deleting all references to python in the System variables PATH fixed the issue for me. You can then use pip as normal again

like image 28
L10Yn Avatar answered Feb 16 '23 15:02

L10Yn