python安装出现的证书问题

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

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

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
原文地址:https://www.cnblogs.com/lobin/p/10475190.html