python
network_error
ai_generated
true
错误:无法获取 URL https://pypi.org/simple/package/:确认 SSL 证书时出现问题:[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1129)
ERROR: Could not fetch URL https://pypi.org/simple/package/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
ID: python/pip-install-error-ssl-certificate-verify-failed
80%修复率
86%置信度
0证据数
2024-05-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
pip 无法验证包索引的 SSL 证书,通常是由于缺少 CA 证书、企业代理拦截或 certifi 包过时。
English
pip cannot verify the SSL certificate of the package index, often due to missing CA certificates, corporate proxy interception, or outdated certifi bundle.
解决方案
-
80% 成功率
pip install --upgrade certifi
-
90% 成功率
sudo apt-get install ca-certificates && sudo update-ca-certificates
-
85% 成功率
pip install --cert /path/to/corporate-ca-bundle.crt package
无效尝试
常见但无效的做法:
-
60% 失败
This bypasses security and may still fail if the proxy requires a specific CA.
-
95% 失败
Reinstalling Python does not fix missing or outdated CA certificates.
-
90% 失败
PyPI redirects HTTP to HTTPS; the SSL error persists.