pip安装第三方库失败
今天安装 frida-tools
时一直提示失败
其中错误有一句:
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
或者:
$ /usr/bin/python3 -c 'import urllib.request; urllib.request.urlopen("https://www.apple.com/")'
...
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)>
我的系统环境:
macOS Catalina 10.15.2 (19C57)
已安装Xcode11,并且Xcode有带Python3.7
解决方案
执行以下两行命令:
/usr/bin/sudo /bin/mkdir /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/etc
/usr/bin/sudo /bin/ln -s /etc/ssl/ /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/etc/
我出问题时的Xcode,默认是没有/etc
这个目录的;使用以上命令后,可以正常安装frida-tools
参考文章
ssl-certificate-verify-failed-error-with-python3-on-macos-10-15
网友评论