【问题标题】:Python: cannot install packages with pipPython:无法使用 pip 安装包
【发布时间】:2021-01-29 09:35:23
【问题描述】:

我试图安装 Python 包但显示如下错误,我认为可能是因为我使用了我公司的笔记本电脑并且它被审查了,但我不确定这是否是原因,如果还有其他原因可能的解决方案请帮助。 蟒蛇 3.7 点 10.0.1

(base) C:\>pip install pyvis
Collecting pyvis
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pyvis/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pyvis/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pyvis/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pyvis/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))': /simple/pyvis/
  Could not fetch URL https://pypi.org/simple/pyvis/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyvis/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping
  Could not find a version that satisfies the requirement pyvis (from versions: )
No matching distribution found for pyvis
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping

【问题讨论】:

    标签: python installation pip package


    【解决方案1】:

    试试下面的命令。

    pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip --trusted-host pypi.org pyvis -vvv
    

    【讨论】:

    • 嗨@CForce99,感谢您的回答,在我输入第一个命令后,它显示:tensorboard 2.3.0 需要 setuptools>=41.0.0,但您将拥有 setuptools 40.2.0不兼容。 google-auth 1.22.0 要求 setuptools>=40.3.0,但您将需要 setuptools 40.2.0,这是不兼容的。
    • 我应该如何获得新的 setuptools?
    • pip install --upgrade setuptools 会尽我所知
    • @XaviorL 你试过--upgrade setuptools吗?
    • 我试过也遇到了同样的问题:>pip install --upgrade setuptools
    【解决方案2】:

    根据您的 cmets 尝试: pip install --upgrade setuptools

    然后重试:pip install pyvis

    【讨论】:

    • 您的答案没有回答 ssl 错误,添加答案的正确方法是编辑原始答案。
    • 据我所知,ssl 错误可能是由 pypi 拒绝旧版本引起的,但您很可能是对的。
    • 你是对的,但由于 ssl 错误,他无法更新 setuptools。
    • 那么我认为解决方案可能是从 setuptools pypi repo 下载文件然后手动使用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 1970-01-01
    • 2016-12-08
    • 2020-11-20
    • 1970-01-01
    相关资源
    最近更新 更多