Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update/upgrade pip itself from inside my virtual environment?

I'm able to update pip-managed packages, but how do I update pip itself? According to pip --version, I currently have pip 1.1 installed in my virtualenv and I want to update to the latest version.

What's the command for that? Do I need to use distribute or is there a native pip or virtualenv command? I've already tried pip update and pip update pip with no success.

like image 504
zakdances Avatar asked Mar 05 '13 10:03

zakdances


People also ask

How do I update pip upgrade?

Updating Pip When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.


2 Answers

pip is just a PyPI package like any other; you could use it to upgrade itself the same way you would upgrade any package:

pip install --upgrade pip

On Windows the recommended command is:

python -m pip install --upgrade pip
like image 129
Cairnarvon Avatar answered Oct 19 '22 23:10

Cairnarvon


The more safe method is to run pip though a python module:

python -m pip install -U pip

On windows there seem to be a problem with binaries that try to replace themselves, this method works around that limitation.

like image 37
Janusz Skonieczny Avatar answered Oct 20 '22 01:10

Janusz Skonieczny