Python资源安装过程出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))…………

Stella981
• 阅读 949

问题:安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError

解决办法: pip install selectivesearch -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

其他源总结:

搜集了一些国内的pip源,如下:

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

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

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

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

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

使用方法很简单,直接 -i 加 url 即可!如下:

Python资源安装过程出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))…………

 如果有报错:

Python资源安装过程出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))…………

使用命令:# pip install pandas  -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

如果想配置成默认的源,方法如下:

需要创建或修改配置文件(一般都是创建),

linux的文件在~/.pip/pip.conf,

windows在%HOMEPATH%\pip\pip.ini),

修改内容为:

1 [global]
2 index-url = http://pypi.douban.com/simple 3 [install] 4 trusted-host=pypi.douban.com

这样在使用pip来安装时,会默认调用该镜像。

临时使用其他源安装软件包的python脚本如下:

 

1 #!/usr/bin/python
2 import os
3 package = raw_input("Please input the package which you want to install!\n")
4  
5  command = "pip install %s -i http://pypi.mirrors.ustc.edu.cn/simple --trusted-host pypi.mirrors.ustc.edu.cn" % package
6 os.system(command)
点赞
收藏
评论区
推荐文章
DaLongggggg DaLongggggg
3年前
python-`if not x:` 和`if x is not None:`和`if not x is None:`使用
代码中经常会有变量是否为None的判断,有三种主要的写法:第一种是ifxisNone;第二种是ifnotx:;第三种是ifnotxisNone(这句这样理解更清晰ifnot(xisNone))。如果你觉得这样写没啥区别,那么你可就要小心了,这里面有一个坑。先来看一下代码:x1notxFalse
达里尔 达里尔
1年前
让元素不能被复制
cssmozuserselect:none;/火狐/webkituserselect:none;/webkit浏览器/msuserselect:none;/IE10/khtmluserselect:none;/早期浏览器/userselect:none;
Wesley13 Wesley13
2年前
java反射, 不看你可别后悔
<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,
Wesley13 Wesley13
2年前
.pip的时候出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))…………
pip的幺蛾子:有时候在用pip安装python中的包的时候,会出先请求失败的现象,一开始还以为是自己的网不够好,后来才发现。。。。。。原因:pip的下载源存在国外和国内之分,一般来说国内的源下载会块很多,国外的源会有速度限制,从而造成请求失败从而不能安装你想要的模块.解决方法:几种国内常用的pip源阿里云:http://mirro
Stella981 Stella981
2年前
AndroidStudio封装SDK的那些事
<divclass"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,2.55,5z"id"raphael
Stella981 Stella981
2年前
Native memory allocation (mmap) failed to map xxx bytes for committing reserved memory
<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,
Stella981 Stella981
2年前
Spring Boot 2下使用Feign找不到@EnableFeignClients的解决办法
<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,2
Wesley13 Wesley13
2年前
.clear 万能清除浮动
htmlbodydiv.clear,htmlbodyspan.clear{background:none;border:0;clear:both;display:block;float:none;
Wesley13 Wesley13
2年前
Java8中的LocalDateTime工具类
<divid"content\_views"class"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,
Stella981 Stella981
2年前
None of the configured nodes are available
1.今天写了一段ES的测试代码,如下:package elasticSearch;import java.net.InetSocketAddress;import java.util.ArrayList;import java.util.List;import java.util.M