python安装出现的证书问题

1. pip install pyenv 安装时出现下图错误

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=): Max retries exceeded with url: /packages///07b67ec0f26f61894ab
65cf1e325c2bd8938f8f4379e989ffadedcbb07e1/pyenv-0.0..tar.gz (Caused by SSLError(SSLCertVerificationError(, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get
local issuer certificate (_ssl.c:)')))

python安装出现的证书问题

2. 解决方案:证书问题

2.1 前面加上trusted-host  ;     pip --trusted-host pypi.python.org --trusted-host pypi.org install --trusted-host files.pythonhosted.org pyenv

2.2 或者在%appdata%路径下新建一个pip文件夹,在文件夹下新建一个pip.ini文件,内容如下

[global]
timeout = 6000
index-url=http://mirrors.aliyun.com/pypi/simple/ #不填也行,使用官方的
[install]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
mirrors.aliyun.com
上一篇:iOS RAC常用方法


下一篇:Calling Circles(UVa 247)(Floyd 算法)