python中的许多操作都需要通过https访问。这包括pip安装,或者只使用http.client.HTTPSConnection,或者在内部使用这些东西的任何模块或应用程序。
如果python是从官方的python pkg安装程序安装的,从https://python.org下载的,那么它使用的是openssl的内部版本,并且不包含根证书。任何使用SSL连接的操作都会导致以下错误:
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
如何安装根证书以消除上述错误?
发布于 2019-08-23 01:07:59
我使用以下命令解决了这个问题:
open /Applications/Python\ 3.7/Install\ Certificates.command
我的机器上有Python 3.7。
检查此链接- Fixing CERTIFICATE_VERIFY_FAILED error when trying requests-html out on Mac
发布于 2020-01-27 18:09:39
在你所有的python版本中解决这个问题的好方法,而且不需要在macOS上检查你的版本
bash /Applications/Python*/Install\ Certificates.command
此命令相当于:
...
bash /Applications/Python\ 2.7/Install\ Certificates.command
bash /Applications/Python\ 3.6/Install\ Certificates.command
bash /Applications/Python\ 3.7/Install\ Certificates.command
...
它帮助了我,希望它也能帮助你
发布于 2017-04-27 21:19:22
如果你仍然安装了python3.5,那么使用python3.5就是一种便宜的方法。
推送到PyPI:
python3.5 setup.py register -r pypitest
python3.5 setup.py sdist upload -r pypitest
pipping似乎在3.6版本开箱即用的情况下工作得很好。
https://stackoverflow.com/questions/42098126
复制相似问题