python安装出现的证书问题

Posted lobin.tong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于python安装出现的证书问题的主要内容,如果未能解决你的问题,请参考以下文章