windows pip 安装报sslerror [SSL: CERTIFICA TE_VERIFY_FAILED]

今天用PIP安装一个新的模块库,突然报告说PIP install 时 报需要SSL模块,HTTPS 服务错

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avaiable.

一开始以为SSL坏了,在Python 里 import ssl 一试, 说找不到PROTOCOL_SSLv2。于是重装SSL N遍, 都报SSL 错。

折腾好久,放弃SSL了。 去网上直接下wheel 本地安装。 结果本地安装仍然要各种组件(原来都是PIP自己下的),搞得没脾气。

最后尝试用国内的PYPI镜像解决了问题。原文如下。 国内的镜像服务器不要HTTPS 访问。

https://blog.csdn.net/testcs_dn/article/details/54374849

windows下配制成默认的配置,随便选一个服务器即可

在你的“C:\Users\你的用户名\”目录下创建“pip”目录,“pip”目录下创建“pip.ini”文件(注意:以UTF-8 无BOM格式编码);
“pip.ini”文件内容:

[global]

index-url=http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

国内镜像
http://pypi.douban.com/simple/ 豆瓣
http://mirrors.aliyun.com/pypi/simple/ 阿里
http://pypi.hustunique.com/simple/ 华中理工大学
http://pypi.sdutlinux.org/simple/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
https://pypi.tuna.tsinghua.edu.cn/simple 清华

原文:https://blog.csdn.net/fumingf1/article/details/81273079 
 

猜你喜欢

转载自blog.csdn.net/david_sheep/article/details/86686708
今日推荐