5
votes

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\\AppData\Local\Programs\Python\Python38\lib\site-packages\pip (python 3.8)

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

2
Have you installed PIP? Is it in your PATH?Sri
Seems like you are sometimes forgetting the -m in python -m pip somecommand or py -m pip somecommand.sinoroc
1. "python -m pip install django" worked. What is the use of "-m"?Freddie Mercury
2. How would I make sure that PIP is in my PATH?Freddie Mercury
Don't modify PATH. See the following for details: snarky.ca/why-you-should-use-python-m-pipsinoroc

2 Answers

8
votes

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.

5
votes

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.