pip install failing on python2

百般思念 提交于 2021-01-26 08:51:25

问题


Following the instructions on this page to install pip on python2 https://linuxhint.com/installing_pip_linux_mint/

It's failing at the last step, $ sudo python2 get-pip.py

with this error,

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/tmp2aZyDl/pip.zip/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

I've tried to look everywhere for a solution, but can't find one. What is it that I'm doing wrong?


回答1:


The correct get-pip.py file for python2 has been moved to https://bootstrap.pypa.io/2.7/get-pip.py




回答2:


Try installing previous version of get-pip

wget https://bootstrap.pypa.io/3.3/get-pip.py

python get-pip.py



来源:https://stackoverflow.com/questions/65866417/pip-install-failing-on-python2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!