python安装插件包错误Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming t
在python环境中安装插件包时,出现错误如:Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded w
现象
在python环境中安装插件包时,出现错误如:
Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))) - skipping Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))) - skipping
原因
系统根证书缺失或过期
解决方案
- 升级证书
# mac
/Applications/Python*/Install\ Certificates.command
# win
pip install --upgrade certifi
- 使用新证书
# mac python3
export SSL_CERT_FILE=$(python3 -m certifi)
# mac python
export SSL_CERT_FILE=$(python -m certifi)
# win python3
export SSL_CERT_FILE=$(python3 -m certifi)
# win python
export SSL_CERT_FILE=$(python -m certifi)
更多推荐
所有评论(0)