【Python】Python安装插件报错,解决方法
一、Python安装插件报错
(venv) D:\Python>pip install dango -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting dango
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] c
ertificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /python/3.7.2/dango/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] c
ertificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /python/3.7.2/dango/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] c
ertificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /python/3.7.2/dango/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] c
ertificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /python/3.7.2/dango/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] c
ertificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /python/3.7.2/dango/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn',
port=443): Max retries exceeded with url: /python/3.7.2/dango/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to
get local issuer certificate (_ssl.c:1056)'))) - skipping
Could not find a version that satisfies the requirement dango (from versions: )
No matching distribution found for dango
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port
=443): Max retries exceeded with url: /python/3.7.2/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get l
ocal issuer certificate (_ssl.c:1056)'))) - skipping
二、解决方法
命令格式:
python install --trusted-host 主机地址 -i 镜像地址 安装软件包名字
例子:
pip install --trusted-host pypi.tuna.tsinghua.edu.cn -i https://pypi.tuna.tsinghua.edu.cn/simple dango