【问题标题】:Error while checking the latest version of pip [duplicate]检查最新版本的 pip 时出错 [重复]
【发布时间】:2018-09-19 03:19:43
【问题描述】:

我正在尝试使用 pip 安装一些软件包并收到错误

pip install docker==2.7.0
  Could not find a version that satisfies the requirement docker==2.7.0 (from versions: )
No matching distribution found for docker==2.7.0

使用-vvv 选项:

HTTPError: 403 Client Error: TLSv1.2+ is required for url: https://pypi.python.org/pypi/pip/json

前几天还没有这个问题

pip 版本:pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

【问题讨论】:

  • 在pip前面使用sudo是否还会出现错误
  • @Stivan 是的,它仍然存在
  • @kichik 似乎是解决方案。我用的是python 2.7.10所以我会尝试升级到2.7.14再试一次
  • @kichik 升级python2.7和Openssl没有帮助

标签: python pip


【解决方案1】:

问题出在与系统 python 链接的旧 openssl 中。 所以我已经从系统中卸载了所有 python 发行版并使用brew install python@2 安装最后一个 python

可以像这样检查链接到 python 的 openssl 版本

Python 2.7.14 (default, Mar 22 2018, 15:04:47)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2o  27 Mar 2018'

【讨论】:

    【解决方案2】:
    curl https://bootstrap.pypa.io/get-pip.py | python -
    

    这对我有用,Mac Sierra 10.12.6...https://github.com/pypa/packaging-problems/issues/130

    【讨论】:

    • 我已经看到了这个问题,但它对我没有用
    猜你喜欢
    • 2022-06-26
    • 1970-01-01
    • 2023-03-31
    • 2018-08-18
    • 2018-10-23
    • 2014-11-15
    • 2017-09-09
    • 1970-01-01
    • 2021-02-08
    相关资源
    最近更新 更多