Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
try using sudo pip install --upgrade pip –  harish.venkat Apr 17 '12 at 20:29
    
I tried that, it said that it upgraded but then using pip --version still gives the same version. –  cwd Apr 18 '12 at 1:12

4 Answers 4

up vote 7 down vote accepted

Remove your system wide installation of pip:

sudo apt-get purge python-pip

Then install a fresh copy of pip:

curl https://raw.github.com/pypa/pip/master/contrib/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

share|improve this answer
    
I would use easy_install pip instead of the curl command. –  Gert Apr 18 '12 at 9:08
    
A more elegant solution would be to ask for backporting 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 9:43

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.

share|improve this answer

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)
share|improve this answer

Default install prefix is /usr/local, use:

sudo pip install --upgrade --install-option="--prefix=/usr" pip 
share|improve this answer
    
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 9 at 16:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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