In Ubuntu 16.04 when you do:
pip install --upgrade pip
you get:
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Fair enough. Now try
pip install --upgrade pip
and you get:
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
So, how to actually get pip 8.1.2?
Its not a good idea to update the system python unless you are actually working on ubuntu code and have a specific reason to. There are a lot of system dependencies you can break by updating with pip instead of using the python libs in the APT repository.
If you are developing python applications and need to change versions of libraries then you should use either a the --user options to pip or create a virtualenv to store your users versions of the libs.
Both of these methods will gracefully fall back to using system libs if they don't have their own copies, virtualenv has more options on how to control that feedback.
pip with --user
This is as easy as just adding --user to the end of all your pip commands, this will put your python libs in ~/.local/lib/pythonX.X (where X.X is your python version number) , they will be looked for here first just be careful about doing this for root if you have to run via sudo as it may effect the system python.
virtualenv
This works in a similar way to that above but is less tied to a specific user so doesn't have the sudo limitation, you can also clone a virtualenv and upgrade it to test changes thus allowing you to revert if it sucks. http://docs.python-guide.org/en/latest/dev/virtualenvs/
It seems like this might be a problem with installing the .whl file for
pip
8.1.2. A work-around to installpip
8.1.2 is to download the source directly from PyPi and install it viasetup.py
.The following worked for me:
This of course is not a solution to install pip 8.1.2 via
pip install --upgrade
, but should squelch the warning until this issue is resolved.sudo -H python -m pip install --upgrade pip
will solve your issue. As someone mentioned above though the system specific requires python 2.7 for certain things... That being said you can upgrade pip without negatively impacting that but you can also install 3.5 alongside if you want to.the
-H
is a flag forsudo
that requests that the security policy set the HOME environment variable to the home directory specified by the target user's password database entry. Depending on the policy, this may be the default behavior.Uninstall pip using apt-get and install it using easy_install. It worked for me.