【疑难杂症】升级Mac系统后python遇到[SSL: CERTIFICATE_VERIFY_FAILED]

[本文出自天外归云的博客园]

同事升级Mac电脑版本后,遇到了[SSL: CERTIFICATE_VERIFY_FAILED]报错:

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)>
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)>

解决办法是在终端执行以下命令:

/Applications/Python\ 3.6/Install\ Certificates.command

这里面3.6替换成你实际的python版本,比如你的python版本是3.8,就把3.6改成3.8:

参考资料:

https://www.knowledgedict.com/tutorial/python-ssl-certificate-verify-failed.html

posted @ 2023-08-25 11:10  天外归云  阅读(267)  评论(0编辑  收藏  举报