Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix "pip"?

I have python 3.8.0 (on a Windows PC)

When I try to run: pip install selenium I get the following error:

Fatal error in launcher: Unable to create process using '"c:\python38\python.exe" "C:\Python38\Scripts\pip.exe" install selenium': The system cannot find the file specified.

python pip install selenium and py pip install selenium both give me this error:

can't open file 'pip': [Errno 2] No such file or directory

pip3 install selenium:

Fatal error in launcher: Unable to create process using '"c:\python38\python.exe" error: "C:\Python38\Scripts\pip3.exe" install selenium': The system cannot find the file specified.

When I run: python -m pip --version I get:

pip 20.0.2 from C:\Users\<UserName>\AppData\Local\Programs\Python\Python38\lib\site-packages\pip (python 3.8)

I'm having the same problems trying to install django as well.

like image 299
Freddie Mercury Avatar asked Apr 17 '20 18:04

Freddie Mercury


People also ask

Why isn't pip install working?

Why is the PIP Install Not Working? The most common reasons for issues with PIP installations is either that an incorrect PIP path is added to the PATH system variable, or the PIP path isn't added at all. This often happens because users forget or don't know to include PIP during the Python installation.

Why is it showing PIP is not recognized?

The error “'pip' is not recognized as an internal or external command” is encountered because of two main reasons that are. PIP Installation path is not added to the system variables: If you have installed python through prompt then you need to configure PIP path manually.


2 Answers

Your output: C:\Users\\AppData\Local\Programs\Python\Python38\lib\site-packages\pip , makes me think that you've messed-up your pip installation.

To recover do the following:

  • Run CMD as admin
  • Do a python -m pip install -U --force pip (this will fix your pip installation)
  • Then close the CMD and open another admin CMD to make sure you get the PATH updates effectively
  • Do pip install -U --force selenium

This should help to solve the issue.

like image 88
Hrisimir Dakov Avatar answered Oct 23 '22 21:10

Hrisimir Dakov


Try below command and it works for me:

python -m pip install -U --force pip

Above command will first uninstall pip from yours system if already installed and install a fresh version. Once done just type pip and press enter. You will see pip common commands and general options.

Now try to install any module as per your choice. For Example:

pip install sklearn

If installation begin means your issue has been resolved.

like image 33
vikasbashu Avatar answered Oct 23 '22 23:10

vikasbashu