Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip2 installation on ubuntu 20.04

Tags:

python

pip

After installing succesfully python2 on ubuntu 20.04 with: sudo apt install python2

I downloaded get-pip.py from https://bootstrap.pypa.io/get-pip.py sha256: ffb67da2e976f48dd29714fc64812d1ac419eb7d48079737166dd95640d1debd

Running:

sudo python2 get-pip.py

Traceback (most recent call last):
File "get-pip.py", line 24226, in
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/tmp6DHWFv/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax

like image 423
Juan A. Muñoz Avatar asked Jan 24 '21 10:01

Juan A. Muñoz


2 Answers

you can use this commands. It's working right now. You have to install with Python2

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2 get-pip.py
like image 166
ritimsiz Avatar answered Oct 08 '22 01:10

ritimsiz


This version seems not working, so I downloaded a previos version from:
https://bootstrap.pypa.io/2.6/get-pip.py. After running the following command:

sudo python2 get-pip.py

pip version 9.0.3 was installed. Following a

sudo pip install --upgrade pip

pip 20.3.4 was installed. Enough to run the python tools I need.

like image 44
Juan A. Muñoz Avatar answered Oct 08 '22 00:10

Juan A. Muñoz