I am trying to upgrade pip from version 7.1.2 to 8.0.2
But I am not able to upgrade it due to some errors. I ran the following command.
user@ubuntu:~/devstack$ pip install --upgrade pip
I am getting following Traceback errors:
Please let me know how can I make it work.
Best Answer
You can either upgrade
pip
globally usingsudo
:Or you can upgrade it for your user only using the
--user
option:Note that I upgrade both
pip
s for Python 2 and Python 3. It's important to upgrade the version for Python 3 first, because the one you upgrade last will later be accessible throughpip
, which must bepip2
by default.Important update:
As of
pip
version 10 (I think), thepip
/pip3
command is broken, due to a change in the package structure which is not compatible with the launch scripts provided from thepython-pip
/python3-pip
packages fromapt
. See Error after upgrading pip: cannot import name 'main' on Stack Overflow for details.Quick fix: Don't run
pip
/pip3
any more, but instead always usepython -m pip
/python3 -m pip
, which will not use the now incompatible executable scripts provided from your system's package manager, or don't upgrade yourpip
/pip3
version to 10 or higher.