PIP was recently (yesterday) upgraded from 1.5.6 to 6.0.1. It broke a couple of my stuff. I'm looking for a way to make the "get-pip.py" script install 1.5.6 instead of the latest version.
Any ideas?
How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .
The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
This is a relatively old question, but I discovered today that recent versions of get-pip.py
allow you to pass in an argument such as pip<6
to ensure that the pip version installed is < 6:
[Nautilus@Nautilus scripts]$ python get-pip.py "pip<6"
Collecting pip<6
Downloading pip-1.5.6-py2.py3-none-any.whl (1.0MB)
100% |████████████████████████████████| 1.0MB 608kB/s
Installing collected packages: pip
Successfully installed pip-1.5.6
This seems to work with any argument form you could pass to pip itself, e.g. >, <, <=, >=, and ==
As I tried to explain in the comments, get-pip.py
in meant to be a bootstrapping method for pip
. The problem it aims to solve is that you need pip
to install pip
.
The script does not allow the user to choose which version of pip
you will get, it automatically downloads the latest version.
You can adapt the script and change
def bootstrap(tmpdir=None):
# Import pip so we can use it to install pip and maybe setuptools too
import pip
# We always want to install pip
packages = ["pip"]
to
def bootstrap(tmpdir=None):
# Import pip so we can use it to install pip and maybe setuptools too
import pip
# We always want to install pip
packages = ["pip==1.5.6"]
Now the script should always install pip-1.5.6
instead of the latest version found on pypi
.
I'm not sure how you're running your script, but you should be able to pull off something like:
python get-pip.py && pip install -I pip==1.5.6
You may need to prepend sudo
to both commands.
https://pip.pypa.io/en/latest/reference/pip_install.html#cmdoption-I
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With