2

I am trying to install a few different things and having issues.

I thought pip could have been the issue on one of the packages I was trying to install. So I decided to try to upgrade pip, following this reference:

https://pip.pypa.io/en/latest/installing.html#install-pip

So I ran :

sudo pip install -U pip

That output was:

Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-6.1.1-py2.py3-none-any.whl#md5=172eb5abab25a5e0f7a7b63c7a49378d
  Downloading pip-6.1.1-py2.py3-none-any.whl (1.1MB): 1.1MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...

Now however when I run:

pip install <package>

I get:

"bash: /usr/bin/pip: No such file or directory"

What can I do to get the new pip working? (And hopefully not have to re-install all of the packages that the older version of pip had installed).

I am very new Ubuntu and to using pip.

Additional:

I tried running:

easy_install pip

This gave me:

Searching for pip
Best match: pip 6.1.1
Adding pip 6.1.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3.4 script to /usr/local/bin
Installing pip3 script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages
Processing dependencies for pip
Finished processing dependencies for pip

Still the pip command is not being recognized.

pip --version

bash: /usr/bin/pip: No such file or directory

More additional: I downloaded the get-pip.py and then ran python get-pip.py. This gave me an error something like "InsecurePlatformWarning"

1

3 Answers 3

1

Once you have upgraded pip you only needed to update your link to your new pip on /usr/bin

sudo ln -s /usr/local/bin/pip /usr/bin/

since the old one has been removed when you upgrade the pip package using pip ;-)

Then, you are ready to go :)

1

This is merely an issue of bash remembering where executables are located. The Ubuntu python-pip package installs the pip executable to /usr/bin/pip, but anything installed via pip goes to /usr/local, meaning it installs the pip executable to /usr/local/bin/pip. However, bash remembers that the command pip is located at /usr/bin/pip, because it has looked up the command before, and tries to execute that without actually searching the path.

You can fix this by running hash -r in all open bash shells, or by opening a new shell, or rebooting. Reinstalling the Ubuntu python-pip package means you will have two different versions of pip installed simultaneously - but /usr/local will be used before /usr, so it ends up working. It's just not an efficient way to do things. :)

2
  • I like your certainty, but I actually still have a /usr/bin/pip in addition to /usr/local/bin/pip, for whatever reason. So folks should check that it actually exists. Run which -a pip and type pip to see how many there are, and if it's actually "remembering" the old location.
    – Andrew
    Jan 17, 2016 at 13:49
  • The OP did not have a /usr/bin/pip. Installing the python-pip package, which installs /usr/bin/pip, "fixed" the OP's issue.
    – kitti
    Apr 12, 2016 at 15:01
0

Try using the package from the repository,

sudo apt-get install python-pip

If this gives you errors, you might first want to do a

sudo apt-get remove python-pip

and then try again with install.

This also shouldn't interfere or remove the modules you already installed.

1
  • The first line seems to have done the trick. Its working now.
    – wgwz
    Apr 23, 2015 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .