Pip is selecting wrong path
Asked Answered
D

5

6

I'm using windows 10 and I got rid of python 3.8 and installed 3.7 as the only python version on my system.

When trying to install libraries using pip I now get the error:

Fatal error in launcher: Unable to create process using '"c:\users\user\appdata\local\programs\python\python38-32\python.exe"  "C:\Users\User\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe" install pygame_menu': The system cannot find the file specified.

when I checked in the console which -a pip I got:

C:\Users\User>which -a pip
/cygdrive/c/Users/User/AppData/Local/Programs/Python/Python38-32/Scripts/pip
/cygdrive/c/Users/User/AppData/Local/Programs/Python/Python37/Scripts/pip

Now when I look for Python in my variable path it is alright... Anyways I can't figure out how to change the path of pip so the right one is selected... besides its pretty weird that ive uninstalled python and pip multiple times and it still gets it wrong every time during installation.

Thanks

Dominy answered 13/8, 2020 at 13:44 Comment(4)
have you tried python -m pip for installing? And maybe editing your system path? Also, if your path is already set correctly, make sure you restart your command prompt tooCrumbly
Have you Tried python -m pip install --upgrade --force-reinstall pipWomanhood
You can remove one of the pip path from the environment variablesUnseal
Having Same Problem I am Referring to #63396570Heathheathberry
V
2

to fix do this :

  1. check if you still have the python38-32 folder in your local variable list

  2. Delete the "%userprofile%\AppData\Local\Programs\Python\Python38" folder

  3. run pip from command line

if the problem still persists then type "environment variables" in the windows search box

and add "%userprofile%\AppData\Local\Programs\Python\Python37" to your system variable named "Path"

This should completely fix your problem

if not

  1. uninstall all the python files including py launcher
  2. reinstall python # when installing you must select ADD PYTHON to system environment variable
Vernal answered 13/8, 2020 at 13:53 Comment(1)
I had to delete all the folders for all older versions of python to get this working... so step 2 repeatedly for each folder.Pollitt
L
15

For me this solution did the job, thanks itsAPK

python -m pip install --upgrade --force-reinstall pip

The cause of this problem was me installing python from Microsoft store and having another version installed from the default installer, when I removed the Microsoft store version it was prompting me with errors.

Laure answered 22/11, 2021 at 16:39 Comment(2)
This helped me with a similar but different problem -- pip was trying to run python from the wrong path -- as in, a different user name, due to how I migrated from another computer. But this still solved my problem beautifully!Fuse
Helped me as well. Though make sure to run following commands in a new terminal, so dependency changes will be applied.Sex
V
2

to fix do this :

  1. check if you still have the python38-32 folder in your local variable list

  2. Delete the "%userprofile%\AppData\Local\Programs\Python\Python38" folder

  3. run pip from command line

if the problem still persists then type "environment variables" in the windows search box

and add "%userprofile%\AppData\Local\Programs\Python\Python37" to your system variable named "Path"

This should completely fix your problem

if not

  1. uninstall all the python files including py launcher
  2. reinstall python # when installing you must select ADD PYTHON to system environment variable
Vernal answered 13/8, 2020 at 13:53 Comment(1)
I had to delete all the folders for all older versions of python to get this working... so step 2 repeatedly for each folder.Pollitt
I
0

When I was facing the same issue I fixed it by checking the python version pointed to by pip3.x executable. The pip3.10 was pointing to /usr/bin/python9 which was causing problems with package installation. Just check if your pip3.x is pointing to the correct python version.

vim $HOME/.local/bin/pip3.10

Python version is on the first line (starting with the '#').

Incarnation answered 5/12, 2022 at 16:21 Comment(0)
T
0

I delete all previous verion of python from %userprofile%\AppData\Roaming and this work to me/

Thrashing answered 8/10 at 19:38 Comment(0)
N
-2

In my case it was as simple as changing the file name. I had it as "pykrige.py" renamed it to something different and that solved it

Nalley answered 27/4 at 23:14 Comment(1)
How is this related to pip?Erythromycin

© 2022 - 2024 — McMap. All rights reserved.