9

On Ubuntu 10.04 I've used apt-get install pip to install pip after which I installed django. Then I tried to uninstall django with pip via pip uninstall django which gives me:

pip: error: No command by the name pip uninstall

From doing some research that is because I'm using an older version.

$pip --version
pip 0.3.1 from /usr/lib/python2.6/dist-packages (python 2.6)

I first realized that this version of pip did not have uninstall when I installed the wrong version of django and tried to uninstall it with

pip uninstall django

and ended up with

pip: error: No command by the name pip uninstall

From another article:

pip 0.3.1 is over two years old, and indeed it does not include the uninstall command. The current version of pip is 1.0.1.

I presume you're using an OS-packaged version of pip; those tend to be quite out of date. Quite a few bugs have been fixed and features added in the last couple years.

So what is the correct way to upgrade it on Ubuntu 10.04 so that I can gain access to the uninstall command?

cwd
  • 44,479
  • 71
  • 146
  • 167

5 Answers5

13

Remove your system wide installation of pip:

sudo apt-get purge python-pip

Then install a fresh copy of pip:

curl  https://bootstrap.pypa.io/get-pip.py | sudo python

Tested on ubuntu 10.04 i686

I suggest you to use virtualenv. For further details see the Official pip documentation

lcipriani
  • 732
  • 6
  • 8
  • I would use `easy_install pip` instead of the `curl` command. – Gert Apr 18 '12 at 09:08
  • A more elegant solution would be to ask for [backporting](https://help.ubuntu.com/community/UbuntuBackports) python-pip 1.0-1 from Ubuntu Oneiric to Lucid. Of course, you can do this manually by yourself, too. – jofel Apr 18 '12 at 09:43
3

As a matter of fact, pip install --upgrade pip does work, but it install a new pip, in my case pip-2.6. So the command to uninstall is pip-2.6 uninstall package-name.

Cachorro
  • 31
  • 1
2

In my case after a sudo pip install --upgrade pip on ubuntu 10.04 /usr/bin/pip is unchanged but /usr/local/bin/pip is pip 1.1

pip --version
pip 0.3.1 from /usr/lib/python2.6/dist-packages (python 2.6)

/usr/local/bin/pip --version
pip 1.1 from /usr/local/lib/python2.6/dist-packages (python 2.6)
nikosnikos
  • 21
  • 1
0

My case: I first removed the old pip and then re-installed the latest version.

apt-get remove python-pip;
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python;
ln -s /usr/local/bin/pip /usr/bin/pip;
Autonomous
  • 103
  • 4
petertc
  • 121
  • 4
0

Default install prefix is /usr/local, use:

sudo pip install --upgrade --install-option="--prefix=/usr" pip 
user49622
  • 21
  • 2
  • I was using pip 1.0 on Ubuntu 12.04. The way I originally installed pip was by running `sudo apt-get install python-pip`. I wanted to upgrade, so I tried your solution. Afterwards, `which pip` did, in fact, output `/usr/bin/pip`, as expected, but running `pip --version` had an error ending with this: `pkg_resources.DistributionNotFound: pip==1.5.5` – Nick May 09 '14 at 16:51