Reputation: 139
Please help me.
$ pip --version pip 7.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
It's OK.
But...
$ sudo pip --version Traceback (most recent call last): File "/usr/bin/pip", line 5, in from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in working_set = WorkingSet._build_master() File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master return cls._build_from_requirements(__requires__) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: pip==6.1.1
Upvotes: 13
Views: 12446
Reputation: 31
pip --version
. Remember the version the pip. Will be useful later. sudo which pip
. The location should be something like /usr/bin/pip-2.7sudo nano /usr/bin/pip-2.7
pip==6.1.1
to pip==9.0.1
or the version you found with --version
. There is not much text to change there.sudo cp /usr/bin/pip-2.7 /usr/bin/pip
. Copy this files to make the same.I need to do this steps every time I upgrade pip. :(
For the upgrading of the pip you can use also the following call, was working for me:
sudo easy_install --upgrade pip.
Upvotes: 0
Reputation: 2135
Assuming two pip versions are present at /usr/bin/pip & /usr/local/bin/pip where first is present for sudo user & second for normal user. From sudo user you can run below command so it will use higher version of pip for installation.
/usr/local/bin/pip install jupyter
Upvotes: 0
Reputation: 501
if you have 2 versions of pip for example /user/lib/pip and /user/local/lib/pip belongs to python 2.6 and 2.7. you can delete the /user/lib/pip and make a link pip=>/user/local/lib/pip.
you can see that the pip commands called from "pip" and "sudo" pip are different. make them consistence can fix it.
Upvotes: 2
Reputation: 1635
Try this:
sudo easy_install --upgrade pip
By executing this you are upgrading the version of pip that sudoer is using.
Upvotes: 17
Reputation: 6341
As you can see with sudo
you run another pip
script.
With sudo
: /usr/bin/pip
which is older version;
Without sudo
: /usr/local/lib/python2.7/site-packages/pip
which is the latest version.
The error you encountered is sometimes caused by using different package managers, common way to solve it is the one already proposed by @Ali:
sudo easy_install --upgrade pip
Upvotes: 0
Reputation: 241
I had the same problem.
sudo which pip
sudo vim /usr/bin/pip
modify any pip==6.1.1
to pip==8.1.2
or the version you just upgrade to.
It works for me.
Upvotes: 24