python 2.7 installerer pakker ved hjælp af pip på windows returnerer SSL fejl

Indlæg af Hanne Mølgaard Plasc

Problem



Miljøet er python 2.7.15 på en Windows 7-pc (Win7 skal bruges på grund af brugerens krav). Når du forsøger at installere pakker som plot og scipy, returneres nedenstående fejl.


     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'",),))


Jeg har forsøgt at bruge kommandoen nedenfor, som returnerer følgende fejl.


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


Fejl:


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


Er der et alternativ til at installere pakker?

Bedste reference