We Are Going To Discuss About can’t install pip anymore with python 2.7?. So lets Start this Python Article.
can’t install pip anymore with python 2.7?
- How to solve can't install pip anymore with python 2.7?
pip install --upgrade "pip < 21.0"
- can't install pip anymore with python 2.7?
pip install --upgrade "pip < 21.0"
Solution 1
pip install --upgrade "pip < 21.0"
Original Author Ryan Liu Of This Content
Solution 2
The latest pip has dropped support for Python 2
And you cannot install the latest pip via get-pip.py using Python 2.7.
Update: Found an answer here with the script for Python 2.7
https://stackoverflow.com/a/65866547/429476.
You should upgrade to Python 3.
You can use your Linux package manager if you using a Linux distro which have only Python2.7. Note – it installs an older version of Pip that that comes from above script.
If you installed Python from a package manager on Linux, you should always install pip for that Python installation using the same source.
https://pip.pypa.io/en/stable/installing/ –> https://packaging.python.org/guides/installing-using-linux-tools/
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1883k 100 1883k 0 0 6584k 0 --:--:-- --:--:-- --:--:-- 6584k
# python get-pip.py --user
Traceback (most recent call last):
File "get-pip.py", line 24226, in <module>
main()
File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpyG_UJ3/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
# sudo apt-get install python-pip
# python -m pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
Original Author Alex Punnen Of This Content
Solution 3
Yeah pip has dropped it’s support to python 2.7. If you still want to use it for python 2.7, downgrading the pip will help you:
sudo easy_install pip==20.3.4
Original Author harshi gupta Of This Content
Solution 4
A working solution:
-
Have an installed python2
-
Have an installed python3 (yes 3)
-
Install a legacy pip to python3 (eg 9):
python3 -m pip install --upgrade "pip==9"
-
Find where it has been installed to:
python3 -m pip show pip
-
Copy to python2’s PATH:
sudo cp -r /home/usr/.local/lib/python3.8/site-packages/pip-9.0.0.dist-info/ /usr/local/lib/python2.7/dist-packages/
sudo cp -r /home/raczb/.local/lib/python3.8/site-packages/pip /usr/local/lib/python2.7/dist-packages/
-
Check:
python2.7 -m pip --version
-
Re-upgrade python3’s pip.
Original Author betontalpfa Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.