4 ms·
People keep misunderstanding this, so just to clarify: pip still works on Python 2! They just aren't doing any new releases for Python 2. $ virtualenv --pyth
by itamarst 6y ago
People keep misunderstanding this, so just to clarify: pip still works on Python 2! They just aren't doing any new releases for Python 2.
$ virtualenv --python=python2.7 /tmp/venv
$ /tmp/venv/bin/pip install --upgrade pip
...
Successfully installed pip-20.3.4
$ /tmp/venv/bin/pip install flask
...
Collecting flask
Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB)
...
The mechanism, as used by other projects as well, is that when you upload a project to PyPI you can set a minimal required version of Python. So when you upgrade, you get the latest version that supports the current version of Python.
Sometimes maintainers screw this up, but so long as the maintainers do this everything Just Works: people on old Python get old packages, people on new Python get new packages.
- arusahni 6y agoWorth clarifying, too: if you have tooling that depends on `get-pip.py`, you'll need to change your reference to https://bootstrap.pypa.io/2.7/get-pip.py https://bootstrap.pypa.io/2.7/get-pip.py
- bitwize 6y agoEven so, the writing is on the wall. The Python 2 repository will eventually become too old to be useful, and the plug will be pulled on it. So upgrade to Python 3, people, if you haven't. Seriously.