解决 ssL module in Python is not available .

在更新pip时报错

完整错误

WARNING: pip is configured with Locations that require TLS/SSL, however the ssL module in Python is not available .

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'einstall'

WARNING: pip is configured with Locations that require TLS/SSL, however the ssL moduLe in Python is not available.

Could not fetch URL

https://mirrors . aliyun. com/pypi/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPooL(host= ' mirrors .aliyun.com', port=443): Max retries exceeded with url: /pypi/simpLe/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

尝试了网上很多种解决办法,包括从library移动文件到scripts,环境变量添加path等等好多方式,都没有成功

最后参考安装包模块出现的下载源问题解决:An HTTPS request has been made /Could not find a version that satisfies the requirement pyopenssl - 也许明天 - 博客园 (cnblogs.com)

才想到可能是信任问题

解决方案:在windows下pip配置代理,可以解决这个问题。

点击此电脑,在最上面的的文件夹窗口输入 : %APPDATA%

按回车跳转到目标目录,在此目录下新建pip文件夹。

在pip文件夹下创建pip.ini文件(注意如果用记事本创建,要删除末尾的".txt")。

打开.ini文件,输入以下内容,关闭即可(注意:源镜像可替换)。

[global]

imeout = 6000

index-url = http://pypi.douban.com/simple

trusted-host = pypi.douban.com

国内源镜像有:

V2EX:http://pypi.v2ex.com/simple

豆瓣:http://pypi.douban.com/simple

中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/

清华:https://pypi.tuna.tsinghua.edu.cn/simple

终于解决!

猜你喜欢

转载自blog.csdn.net/Kerry_Blue/article/details/128850042