python pip 安装包下载过慢的解决方法

<!doctype html>python pip 安装包下载过慢的解决方法

python pip 安装包下载过慢的解决方法 socket.timeout: The read operation timed out

【转载内容】

1、使用pip安装第三方库过慢导致超时无法安装:   

 
 
1
pip install reportlab
 
 

出现异常 socket.timeout: The read operation timed out

2、 原因

    pip下载的时国外的资源,速度过慢,应该切换至国内镜像

3、解决方法:  更换 pip 源自国内镜像,在 pip install 后面添加 -i https://pypi.tuna.tsinghua.edu.cn/simple

上面是镜像地址,网上可以查到,这里提供两个速度快的:

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

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

4、使用示例:  

 
 
 
1
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple reportlab
 
 
posted @ 2020-04-16 23:00  奋斗宝宝冷风  阅读(195)  评论(0)    收藏  举报