pip install schlägt fehl mit "Verbindungsfehler: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
Ich bin sehr neu in Python und versuche, > pip install linkchecker
auf Windows 7. Einige Hinweise:
- pip install schlägt fehl, egal welches Paket. Zum Beispiel führt
> pip install scrapy
auch zu dem SSL-Fehler. - Die Vanilla-Installation von Python 3.4.1 enthielt pip 1.5.6. Das erste, was ich versuchte, war Linkchecker zu installieren. Python 2.7 war bereits installiert, es kam mit ArcGIS.
python
undpip
waren nicht auf der Kommandozeile verfügbar, bis ich 3.4.1 installiert hatte. > pip search linkchecker
funktioniert. Vielleicht liegt das daran, dass pip search das SSL-Zertifikat der Website nicht verifiziert.- Ich bin in einem Firmennetzwerk, aber wir gehen nicht über einen Proxy, um das Internet zu erreichen.
- Jeder Firmencomputer (auch meiner) hat eine vertrauenswürdige Stammzertifizierungsstelle, die aus verschiedenen Gründen verwendet wird, u. a. um die Überwachung des TLS-Verkehrs auf https://google.com zu ermöglichen. Ich bin nicht sicher, ob das etwas damit zu tun hat.
Hier ist der Inhalt meiner pip.log, nachdem ich pip install linkchecker
ausgeführt habe:
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
Mit diesem Parameter können Sie ein Zertifikat angeben:
Siehe: Docs » Referenzhandbuch » pip
Wenn die Angabe des Root-Zertifikats Ihres Unternehmens nicht funktioniert, funktioniert vielleicht das cURL-Zertifikat: http://curl.haxx.se/ca/cacert.pem
Sie müssen eine PEM-Datei und keine CRT-Datei verwenden. Wenn Sie eine CRT-Datei haben, müssen Sie die Datei in PEM konvertieren Es gibt Berichte in den Kommentaren, dass dies jetzt mit einer CRT-Datei funktioniert, aber ich habe das nicht überprüft.
Prüfen Sie auch: SSL-Zertifikatsüberprüfung.
Sie können versuchen, den SSL-Fehler zu umgehen, indem Sie http anstelle von https verwenden. Das ist natürlich nicht optimal in Bezug auf die Sicherheit, aber wenn Sie es eilig haben, sollte es funktionieren:
Ich habe dieses Problem gelöst, indem ich meine pip entfernt und die ältere Version von pip installiert habe: https://pypi.python.org/pypi/pip/1.2.1