Any trick to make -pip.py install a specific pip version?

PIP was recently (yesterday) upgraded from 1.5.6 to 6.0.1. It broke a couple of my things. I'm looking for a way to make the "get-pip.py" script install 1.5.6 instead of the latest version.

Any ideas?

+3


source to share


3 answers


I'm not sure how you are using your script, but you should be able to do something like:

python get-pip.py && pip install -I pip==1.5.6

      



You may need to add sudo

to both commands.

https://pip.pypa.io/en/latest/reference/pip_install.html#cmdoption-I

+3


source


This is a relatively old question, but today I found that recent versions get-pip.py

allow an argument to be passed, for example pip<6

, to ensure that the installed protocol version 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 form of argument you could pass to pip itself, eg. >, <, <=,> = and ==

+7


source


As I tried to explain in the comments, get-pip.py

as a bootstrap method for pip

. The problem it solves is what you need to pip

install pip

.

The script doesn't let the user choose the version pip

you get, it downloads the latest version automatically.

You can adapt your 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

.

+4


source







All Articles