32

I did pip install -U easyinstall, and then pip install -U pip to upgrade my pip. However, I get this error now when trying to use pip:

root@d8fb98fc3a66:/# which pip
/usr/local/bin/pip
root@d8fb98fc3a66:/# pip
bash: /usr/bin/pip: No such file or directory

This is on an ubuntu 12.04 in a docker image.

4
  • Have you tried to reinstall pip?
    – user2961646
    Oct 10, 2014 at 15:24
  • Yes, but that just leaves me with an un-updated version of pip...which starts this cycle again
    – dl8
    Oct 10, 2014 at 15:27
  • Have you tried easy_install pip?
    – user2961646
    Oct 10, 2014 at 15:28
  • 1
    Yes, doesn't work. However, falsetru solved this issue. Will accept his answer when I can.
    – dl8
    Oct 10, 2014 at 15:29

2 Answers 2

78

One reason can be remembed locations.

You can clear the cached locations by issuing following command:

hash -r

SIDENOTE: Instead of which, using type command, you can see the hashed location:

$ type pip
pip is /usr/local/bin/pip
$ pip -V
pip 1.5.6 from /usr/local/lib/python2.7/dist-packages (python 2.7)
$ type pip
pip is hashed (/usr/local/bin/pip)
0
1

If doing hash -r doesn't work, it's possible that the new pip got installed in /usr/local/bin/ instead of the old one in /usr/bin/. And it so happens that the new location is not in the list of paths searched for executables.

In that case, either fix the list of paths or copy the executables:

cp -p /usr/local/bin/pip* /usr/bin/

You may also hardlink the executables instead of copying them (this may ensure that future upgrades are done correctly).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.