Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

python - pip2 installation on ubuntu 20.04

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

question from:https://stackoverflow.com/questions/65869381/pip2-installation-on-ubuntu-20-04

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...