python
network_error
ai_generated
true
错误:由于OSError无法安装包:HTTPS连接池超过最大重试次数(由SSLError引起:证书验证失败:无法获取本地颁发者证书)
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/... (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate')))
ID: python/pip-ssl-certificate-verify-failed
80%修复率
85%置信度
0证据数
2025-01-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.10 | active | — | — | — |
根因分析
由于系统缺少或CA证书过期,SSL证书验证失败。
English
SSL certificate verification fails due to missing or outdated CA certificates on the system.
解决方案
-
90% 成功率 Update CA certificates
pip install --upgrade certifi # Or system level: sudo update-ca-certificates
-
85% 成功率 Use a custom CA bundle if behind corporate proxy
pip install --cert /path/to/custom-ca-bundle.crt package
无效尝试
常见但无效的做法:
-
Disabling SSL verification with --trusted-host
30% 失败
Security risk; may work but exposes to man-in-the-middle attacks.
-
Using --cert with wrong path
70% 失败
Path to certificate may be incorrect or file missing.