I have a problem when I try to use pip in any way. I\'m using Ubuntu 16.04.4
I should say that I\'ve used it already, and I never had any problem, but starting today
I've seen this issue when PYTHONPATH
was set to include the built-in site-packages
directory. Since Python looks there automatically it is unnecessary and can be removed.
Refer to this issue list
sudo easy_install pip
works for me under Mac OS
For python3
, may try sudo easy_install-3.x pip
depends on the python 3.x version. Or python3 -m pip install --user --upgrade pip
I just encountered the same problem and in my case, it turns out this is a conflict between the python installation in my virtualenv and the site-wide python (Ubuntu). What solves it for me is to run pip in this way, to force usage of the correct python installation (in my vortualenv):
python3 -m pip install PACKAGE
instead of
pip3 install PACKAGE
I realised this when I tried to follow some of the answers here that suggest re-installing pip and the error output I got was pointing to an existing site-wide python library path although I had activated my virtualenv. Worth trying before deleting and re-installing stuff.
you can remove it first, and install again ,it will be ok. for centos:
yum remove python-pip
yum install python-pip
This solution works for me:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
or use sudo for elevated permissions (sudo python3 get-pip.py --force-reinstall
).
Of course, you can also use python
instead of python3
;)
Source
The following solution solved the problem on my machine for python2.7 "$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py" and then "$ sudo python2.7 get-pip.py --force-reinstall"