pip install fallisce con "errore di connessione: [SSL: CERTIFICATE_VERIFY_FAILED] verifica del certificato fallita (_ssl.c:598)"
Sono molto nuovo di Python e sto cercando di > pip install linkchecker
su Windows 7. Alcune note:
- pip install sta fallendo indipendentemente dal pacchetto. Per esempio,
> pip install scrapy
provoca anche l'errore SSL. - L'installazione vaniglia di Python 3.4.1 includeva pip 1.5.6. La prima cosa che ho provato a fare è stata installare linkchecker. Python 2.7 era già installato, è venuto con ArcGIS.
python
epip
non erano disponibili dalla linea di comando finché non ho installato la 3.4.1. > pip search linkchecker
funziona. Forse perché pip search non verifica il certificato SSL del sito.- Sono in una rete aziendale ma non passiamo attraverso un proxy per raggiungere Internet.
- Ogni computer dell'azienda (incluso il mio) ha una Trusted Root Certificate Authority che viene utilizzata per vari motivi, tra cui l'abilitazione del monitoraggio del traffico TLS su https://google.com. Non sono sicuro che questo abbia qualcosa a che fare con questo.
Ecco il contenuto del mio pip.log dopo aver eseguito pip install linkchecker
:
Downloading/unpacking linkchecker
Getting page https://pypi.python.org/simple/linkchecker/
Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'http.client.CannotSendRequest'>: Request-sent)
Will skip URL https://pypi.python.org/simple/ when looking for download links for linkchecker
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for linkchecker:
* https://pypi.python.org/simple/linkchecker/
Getting page https://pypi.python.org/simple/linkchecker/
Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
Could not find any downloads that satisfy the requirement linkchecker
Cleaning up...
Removing temporary dir C:\Users\jcook\AppData\Local\Temp\pip_build_jcook...
No distributions at all found for linkchecker
Exception information:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "C:\Python34\lib\site-packages\pip\index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for linkchecker
350
3
Potete specificare un certificato con questo parametro:
Vedere: Docs » Reference Guide » pip
Se specificare la root cert della vostra azienda non funziona, forse quella di cURL funzionerà: http://curl.haxx.se/ca/cacert.pem
È necessario utilizzare un file PEM e non un file CRT. Se hai un file CRT dovrai convertire il file in PEM Ci sono rapporti nei commenti che questo ora funziona con un file CRT ma non ho verificato.
Controllare anche: Verifica Cert SSL.
Potete provare a bypassare l'errore SSL usando http invece di https. Naturalmente questo non è ottimo in termini di sicurezza, ma se avete fretta dovrebbe funzionare:
Ho risolto questo problema rimuovendo il mio pip e installando la vecchia versione di pip: https://pypi.python.org/pypi/pip/1.2.1