Prepare:
https://pypi.org Go to the website to download the desired version of pip
View the corresponding historical version
1. Installation
1. Install pip with apt-get
$ sudo apt-get remove python-pip
- 1
But sometimes the version of pip installed through apt-get is too old, and when some packages are installed using the old version of pip, a reminder will be reported to upgrade pip. If you want to upgrade the latest pip, you need to uninstall pip first, the command is
sudo apt-get remove python-pip
- 1
Then install pip from source according to the following method.
2. Install pip from source
Go to https://pypi.python.org/pypi/pip to download the source code of the corresponding version. It is recommended to use this compressed format: pip-9.0.1.tar.gz, then go to the download directory, unzip and enter the file :
$ tar -xzvf pip-9.0.1.tar.gz
$ cd pip-9.0.1
- 1
- 2
When entering the following
$ python setup.py install
- 1
May report an error:
running install
error: can't create or remove files in install directory
- 1
- 2
This is because of insufficient permissions, enter the following command:
$ sudo python setup.py install
- 1
Then execute the following, the installation is successful.
running install
... ...
Processing dependencies for pip==9.0.1
Finished processing dependencies for pip==9.0.1