3.6
script: - apt-get update - apt-get install -y python-dev - curl -O https://bootstrap.pypa.io/get-pip.py - python get-pip.py ... and a few more steps尝试在bitbucket CI中使用以下步骤安装pip时出现常见错误:
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/tmpUgc5ng/pip.zip/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}") SyntaxError: invalid syntax错误表现为:
为什么会这样失败?
如何解决问题
curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py python get-pip.py python -m pip install --upgrade "pip < 21.0"Python 2.7:从安装https://bootstrap.pypa.io/pip/2.7/
python -m pip install --upgrade "pip < 19.2"
以上是为什么 pip 安装在 Python < 3.6 上失败以及如何修复它?的详细内容。更多信息请关注PHP中文网其他相关文章!