问题场景
在mac OS 中运行python程序,涉及url时,比如下载文件,遇到SSL验证失败问题:certificate verify failed: unable to get local issuer certificate
解决方法
- 在
python
的安装文件下,找到Install Certificates.command
文件,双击运行即可解决问题 - 查看文件源码,该文件本质上是
pip install --upgrade certifi
的python
脚本版。所以可以直接执行pip install --upgrade certifi
也是一样的,即更新certifi
参考
https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate