安裝 Python 模組時發生錯誤:確認 SSL 憑證時出現問題。當使用者透過 JMP 安裝某些 Python 軟體包時,可能會遇到以下錯誤。該錯誤發生在嘗試存取公司防火牆後面的軟體包儲存庫時。
無法取得 URL https://pypi.org/simple/pip/ :確認 ssl 憑證時出現問題:HTTPSConnectionPool(host='pypi.org',port=443):url 超出最大重試次數:/simple/pip/(由 SSLError(SSLCertVerificationError(1.DError(13)憑證驗證失敗:憑證鏈中的自簽章憑證(_ssl.c:1016)')))跳過...
解決方案:
- Try upgrading PIP setuptools and 添加包certifi 到包列表。
jmputils.jpip('install --upgrade', 'pip setuptools certifi')
- 讓您的 IT 將軟體包儲存庫的 URL 列入白名單,以便可以在公司防火牆之外進行存取。
- Try to install the package via the Windows Command Line using the trusted-host option.
"C:\Program Files\JMP\<JMPPRO>\<VERSION>\jmp_python.exe" -m pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user <MODULE name="">
E.G., installing numpy within JMP Pro. "C:\Program Files\JMP\JMPPRO\18\jmp_python.exe" -m pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user numpy
</MODULE></VERSION></JMPPRO>
注意:第三種解決方案不安全,可能會導致其他問題。在考慮此解決方案之前,請先與您的 IT 部門進行評估。