python 2.7使用pip在Windows上安装软件包返回SSL错误

时间:2018-06-11 16:28:07

标签: windows python-2.7 pip

在Windows 7 PC上环境是python 2.7.15(由于用户要求,必须使用Win7)。尝试安装plotly和scipy等软件包时,会返回以下错误。

     Certificate did not match expected hostname: files.pythonhosted.org. Certifica
    te: {'crlDistributionPoints': (u'http://cdp.rapidssl.com/RapidSSLTLSRSACAG1.crl'
    ,), 'subjectAltName': (('DNS', '*.logicnow.us'), ('DNS', 'logicnow.us')), 'notBe
    fore': u'Mar 14 00:00:00 2018 GMT', 'caIssuers': (u'http://cacerts.rapidssl.com/
    RapidSSLTLSRSACAG1.crt',), 'OCSP': (u'http://status.rapidssl.com',), 'serialNumb
    er': u'035BBD7099460760E357EF1F5E12C586', 'notAfter': 'May 12 12:00:00 2020 GMT'
    , 'version': 3L, 'subject': ((('commonName', u'*.logicnow.us'),),), 'issuer': ((
    ('countryName', u'US'),), (('organizationName', u'DigiCert Inc'),), (('organizat
    ionalUnitName', u'www.digicert.com'),), (('commonName', u'RapidSSL TLS RSA CA G1
    '),))}
      Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
     after connection broken by 'SSLError(CertificateError("hostname 'files.pythonho
    sted.org' doesn't match either of '*.logicnow.us', 'logicnow.us'",),)': /package
    s/c4/0c/1b8241395302fd66b34a0fe0774ed83632afd14aa5c995b262fb7b3ac540/plotly-2.7.
    0.tar.gz
      Certificate did not match expected hostname: files.pythonhosted.org. Certifica
    te: {'crlDistributionPoints': (u'http://cdp.rapidssl.com/RapidSSLTLSRSACAG1.crl'
    ,), 'subjectAltName': (('DNS', '*.logicnow.us'), ('DNS', 'logicnow.us')), 'notBe
    fore': u'Mar 14 00:00:00 2018 GMT', 'caIssuers': (u'http://cacerts.rapidssl.com/
    RapidSSLTLSRSACAG1.crt',), 'OCSP': (u'http://status.rapidssl.com',), 'serialNumb
    er': u'035BBD7099460760E357EF1F5E12C586', 'notAfter': 'May 12 12:00:00 2020 GMT'
    , 'version': 3L, 'subject': ((('commonName', u'*.logicnow.us'),),), 'issuer': ((
    ('countryName', u'US'),), (('organizationName', u'DigiCert Inc'),), (('organizat
    ionalUnitName', u'www.digicert.com'),), (('commonName', u'RapidSSL TLS RSA CA G1
    '),))}
    Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=
    'files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/c4
    /0c/1b8241395302fd66b34a0fe0774ed83632afd14aa5c995b262fb7b3ac540/plotly-2.7.0.ta
    r.gz (Caused by SSLError(CertificateError("hostname 'files.pythonhosted.org' doe
    sn't match either of '*.logicnow.us', 'logicnow.us'",),))

我尝试使用以下命令返回以下错误。

pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org plotly

错误:

Collecting plotly
  Downloading https://files.pythonhosted.org/packages/c4/0c/1b8241395302fd66b34a
0fe0774ed83632afd14aa5c995b262fb7b3ac540/plotly-2.7.0.tar.gz
     - 10kB 1.5MB/s
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have u
pdated the package versions, please update the hashes. Otherwise, examine the pa
ckage contents carefully; someone may have tampered with them.
    plotly from https://files.pythonhosted.org/packages/c4/0c/1b8241395302fd66b3
4a0fe0774ed83632afd14aa5c995b262fb7b3ac540/plotly-2.7.0.tar.gz#sha256=f7305816a4
23fd899da20919282445703118aeece19a54fb97be4cbf302341f8:
        Expected sha256 f7305816a423fd899da20919282445703118aeece19a54fb97be4cbf302341f8
             Got        5bc26e972b40ab4355857a8140d0ef730b267cfe26e8aff2a8dca148f227e5d7

是否有替代安装包的方法?

0 个答案:

没有答案