Python中pip的SSL异常

生物信息学 2020-06-10

使用python中的pip安装一些组件,都报错,与 SSL有关:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version‘),)‘: /simple/pip/

Python中pip的SSL异常

解决方案

(1)在系统目录C:\Users\用户\AppData\Roaming新建pip文件夹;

(2)在pip文件夹下新建pip.ini文件,并写入如下配置:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com

 Python中pip的SSL异常

一些国内的pip安装源:

阿里云 http://mirrors.aliyun.com/pypi/simple/ 

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

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

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

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

切换了国内的安装源,安装就正常了。

Python中pip的SSL异常

相关推荐

huavhuahua / 0评论 2020-05-15
duanlove技术路途 / 0评论 2020-05-01