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)>
我的系統(tǒng)環(huán)境:
macOS Catalina 10.15.2 (19C57)
已安裝Xcode11,并且Xcode有帶Python3.7
解決方案
執(zhí)行以下兩行命令:
/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吓懈,默認(rèn)是沒有/etc
這個目錄的;使用以上命令后千扶,可以正常安裝frida-tools
參考文章
ssl-certificate-verify-failed-error-with-python3-on-macos-10-15