I am new to Linux and Ubuntu.
I was trying to upgrade pip but ran into this…
$ sudo pip install --upgrade pip
Cannot fetch index base URL https://pypi.python.org/simple/
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.0-py2.py3-none-any.whl#md5=b108384a762825ec20345bb9b5b7209f
Downloading pip-7.1.0-py2.py3-none-any.whl (1.1MB): 1.1MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.4
Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed pip
Cleaning up...
Any idea why?
Best Answer
Edit:
or
-U
is shorthand for--upgrade
.Old answer:
The
apt
system andPyPI
uses two different mechanisms.In Ubuntu's repositories many modules of
python
are available as packages, but they are not much in numbers as compared to PyPI (The Python Package Index). To remain consistent about upgrading a package you need to consider the method you have used initially used to install it.So if you have installed a package (module) from
PyPI
usingpip
then you should usedpip
to upgrade the package fromPyPI
(includingpip
itself). On the other hand if you have usedapt
system to install a module (as package) you need to useapt
to upgrade that again.In a nutshell, run the following to upgrade
python-pip
to the latest version :