按照本页上的说明在python2 https://linuxhint.com/installing_pip_linux_mint/上安装pip
最后一步失败了,$ sudo python2 get-pip.py出现这个错误

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
我尝试到处寻找解决方案,但是找不到。我做错了什么事?

最佳答案

python2的正确get-pip.py文件已移至https://bootstrap.pypa.io/2.7/get-pip.py

关于python - 在python2上pip安装失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/65866417/

10-16 22:06