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.
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.
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.
I had the same problem and found the solution:
First check whether pip installed or not , in command prompt try pip --version, you should get something like this - pip 22.0.4.
if not installed (command not recognized) try to use install pip-
using curl, try this command -
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
then check again with pip --version
This website has detailed steps.
Do in your terminal (fix your pip installation) 🖇️🔗
python -m pip install -U --force pip
Then Do
pip install -U --force selenium
I am new in working with a kinect. I am using a Mac OS Sierra 10.12.6.
Wheneve I try to update python with :
sudo -H python2 -m pip install -U pip # Update pip
I got this error:
File "<stdin>", line 1
sudo -H python2 -m pip install -U pip # Update pip
^
SyntaxError: invalid syntax
How do we fix it?
What you are doing is running a console command inside python shell,
press ctrl+D to exit out of python shell and then try executing the pip upgrade command
to upgrade pip using pip itself
pip install --upgrade pip # run in console/terminal
to upgrade pip using python
python -m pip install --upgrade pip # run in console/terminal
You can avoid the need for sudo if you're just a single user on your machine. This also avoids potentially messing around with the system-wide installation.
Use
python2.7 -m pip install pip --upgrade --user
The --user option will install the updated pip package just for your user account. Everytime you use python2.7, it will use the newer pip package.
System routines will not see the newer pip package, nor be bothered by it.
python2.7 is needed, because python2 doesn't really exist: it's either python or python2.7 for version 2. Python version 3 doesn't (apparently) exist by default on macOS.
I am trying to install Django in my windows 7 machine, as a prerequisite, I am installing virtualenvwrapper:
pip install virtualenvwrapper-win
But it throws the following error:
Error [WinError 87] The parameter is incorrect while executing command
python setup.py egg_info
Could not install packages due to an EnvironmentError: [WinError 87] The paramet
er is incorrect
[NOTE]:
Python version : Python 3.7.0b4
pip version: pip 10.0.1
Try using pyenv:
Step 1:
install virtualenv using pip
pip install virtualenv
Step 2
In a folder, open cmd and run:
python -m venv virtualenvname
eg:
python -m venv india
Step 3: Activate your Virtual environment by:
india\Scripts\activate
Note: S of sripts has to be in caps
Now you must see india before location in your cmd. If yes then your virtual env has been activated.
Something Like this:
(india) D:\dev\python\django\
pip3 -m venv yourprojectname
Are you trying my command. I got the error like you did with this command I got the problem
but, you can apply the following commands
py -m pip install --user virtualenv
py -m virtualenv env
OR
python3 -m pip install --user virtualenv
python3 -m virtualenv env
I have an Amazon EC2 instance. On that was just python 2.7 installed. So I installed Python3 with the command "sudo yum install python34".
Then I tried to install modules with "pip install package". The terminal told me, that I can upgrade pip. So i upgraded pip. No my instance either find the command pip or pip3.
I googled and find that I have to use "python -m pip install SomePackage" I installed a module and tried to start one of my scripts with "python3 script.py"
I got the information that my module still isn't installed. I tried to install it again. It showed me that my module is already installed but in the python2.7 folder.
So what is the right command to use pip with python3.4 instead of python2.7?
With all the following commands, I get the information that there is no module named pip or pip3:
"python3 -m pip install package"
"python34 -m pip install package"
"python3 -m pip3 install package"
"python3.4 -m pip install package"
"pip install package"
"pip3 install package" (Package already installed in python2.7)
"pip3.4 install package"
You can force package install for python3 by:
[sudo] python3 -m pip install [package]
try # pip install --upgrade pip. this would upgrade pip8.1.1(for python2.7) to 8.1.2(for python3) or
try this https://bootstrap.pypa.io/get-pip.py, it would install pip2 and pip3 as well as setup properly, so this is recommended.
I'm able to update pip-managed packages, but how do I update pip itself? According to pip --version, I currently have pip 1.1 installed in my virtualenv and I want to update to the latest version.
What's the command for that? Do I need to use distribute or is there a native pip or virtualenv command? I've already tried pip update and pip update pip with no success.
pip is just a PyPI package like any other; you could use it to upgrade itself the same way you would upgrade any package:
pip install --upgrade pip
On Windows the recommended command is:
python -m pip install --upgrade pip
The more safe method is to run pip though a python module:
python -m pip install -U pip
On windows there seem to be a problem with binaries that try to replace themselves, this method works around that limitation.
In my case my pip version was broken so the update by itself would not work.
Fix:
(inside virtualenv):easy_install -U pip
I tried all of these solutions mentioned above under Debian Jessie. They don't work, because it just takes the latest version compile by the debian package manager which is 1.5.6 which equates to version 6.0.x. Some packages that use pip as prerequisites will not work as a results, such as spaCy (which needs the option --no-cache-dir to function correctly).
So the actual best way to solve these problems is to run get-pip.py downloaded using wget, from the website or using curl as follows:
wget https://bootstrap.pypa.io/get-pip.py -O ./get-pip.py
python ./get-pip.py
python3 ./get-pip.py
This will install the current version which at the time of writing this solution is 9.0.1 which is way beyond what Debian provides.
$ pip --version
pip 9.0.1 from /home/myhomedir/myvirtualenvdir/lib/python2.7/dist-packages (python 2.7)
$ pip3 --version
pip 9.0.1 from /home/myhomedir/myvirtualenvdir/lib/python3.4/site-packages (python 3.4)
In case you are using venv any update to pip install will result in upgrading the system pip instead of the venv pip. You need to upgrade the pip bootstrapping packages as well.
python3 -m pip install --upgrade pip setuptools wheel
for windows,
go to command prompt
and use this command
python -m pip install -–upgrade pip
Dont forget to restart the editor,to avoid any error
you can check the version of the pip by
pip --version
if you want to install any particular version of pip , for example version 18.1 then use this command,
python -m pip install pip==18.1
pip install --upgrade pip
In UBUNTU 18.04 I got the following error when I execute the above command:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/bin/pip'
Consider using the `--user` option or check the permissions.
The below command solves my problem:
pip install --upgrade pip --user
Upgrading pip using 'pip install --upgrade pip' does not always work because of the dreaded cert issue: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version
I like to use the one line command for virtual envs:
curl https://bootstrap.pypa.io/get-pip.py | python -
Or if you want to install it box wide you will need
curl https://bootstrap.pypa.io/get-pip.py | sudo python -
you can give curl a -s flag if you want to silence the output when running in an automation script.
To get this to work for me I had to drill down in the Python directory using the Python command prompt (on WIN10 from VS CODE). In my case it was in my AppData\Local\Programs\Python\python35-32 directory. From there now I ran the command...
python -m pip install --upgrade pip
This worked and I'm good to go.
For linux
python3 -m pip install --upgrade pip
For windows:
Type Command Prompt in the Windows search box
In the Command Prompt, type cd\
Press Enter, and you’ll see the drive name C:\>
Locate your Python application path, which is the folder where you originally installed Python
Here is an example of a Python application path:
C:\Users\Ron\AppData\Local\Programs\Python\Python39
Once you retrieved the Python application path, type the following command in the Command Prompt:
cd followed by your Python application path
For our example:
C:\>cd C:\Users\Ron\AppData\Local\Programs\Python\Python39
Press Enter
Type python -m pip install --upgrade pip and press Enter
In my case this worked from the terminal command line in Debian Stable
python3 -m pip install --upgrade pip
Open Command Prompt with Administrator Permissions, and repeat the command:
python -m pip install --upgrade pip
pip version 10 has an issue. It will manifest as the error:
ubuntu#mymachine-:~/mydir$ sudo pip install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
The solution is to be in the venv you want to upgrade and then run:
sudo myvenv/bin/pip install --upgrade pip
rather than just
sudo pip install --upgrade pip
I was in a similar situation and wanted to update urllib3 package.
What worked for me was:
pip3 install --upgrade --force-reinstall --ignore-installed urllib3==1.25.3
On my lap-top with Windows 7 the right way to install latest version of pip is:
python.exe -m pip install --upgrade pip
First, do this:
sudo apt install python3-pip python-setuptools-doc
Then, as a non-root user (NEVER, never run pip* as root!):
# N.B. bash shell works for this, I have never tested with other shells!
. ....your_virtualenv_folder/bin/activate
pip3 install -U pip
Note: -U is a synonym for --upgrade, as far as I know.
I had installed Python in C:\Python\Python36 so I went to the Windows command prompt and typed cd C:\Python\Python36 to get to the right directory. Then entered the python -m install --upgrade pip all good!
Single Line Python Program
The best way I have found is to write a single line program that downloads and runs the official get-pip script. See below for the code.
The official docs recommend using curl to download the get-pip script, but since I work on windows and don't have curl installed I prefer using python itself to download and run the script.
Here is the single line program that can be run via the command line using Python 3:
python -c "import urllib.request; exec(urllib.request.urlopen('https://bootstrap.pypa.io/get-pip.py').read())"
This line gets the official "get-pip.py" script as per the installation notes and executes the script with the "exec" command.
For Python2 you would replace "urllib.request" with "urllib2":
python -c "import urllib2; exec(urllib2.urlopen('https://bootstrap.pypa.io/get-pip.py').read())"
Precautions
It's worth noting that running any python script blindly is inherently dangerous. For this reason, the official instructions recommend downloading the script and inspecting it before running.
That said, many people don't actually inspect the code and just run it. This one-line program makes that easier.
I had a similar problem on a raspberry pi.
The problem was that http requires SSL and so I needed to force it to use https to get around this requirement.
sudo pip install --upgrade pip --index-url=https://pypi.python.org/simple
or
sudo pip-3.2 --upgrade pip --index-url=https://pypi.python.org/simple/
Head to your command prompt and type the following:
python -m pip install --upgrade pip
While updating pip in virtual env use full path in python command
Envirnments folder struture
myenv\scripts\python
h:\folderName\myenv\scripts\python -m pip install --upgrade pip
Very Simple. Just download pip from https://bootstrap.pypa.io/get-pip.py . Save the file in some forlder or dekstop. I saved the file in my D drive.Then from your command prompt navigate to the folder where you have downloaded pip. Then type there
python -get-pip.py
In linux
I will update with this code
sudo -H pip3 install --upgrade pip