开发者社区> 小蓝枣> 正文

pip 安装库失败问题:Retrying (Retry(total=4, connect=None, read=None, redirect=None, status =None)),原因及解决办法

简介: pip 安装库失败问题:Retrying (Retry(total=4, connect=None, read=None, redirect=None, status =None)),原因及解决办法
+关注继续查看

本想用安装一个 requests 库,发现安装报错了。看报错日志感觉是连接它的 pypi 库下载官网有问题,使用默认的 pip 库下载地址安装本来就很慢。

我就试了试,改了个阿里云的镜像地址,然后就好了,速度也变快了。

pip安装python库秒速下载:更改pip数据源。阿里云国外镜像。

报错信息:

C:\Users\Administrator>pip install requests
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status
=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con
nection.VerifiedHTTPSConnection object at 0x0354AE90>: Failed to establish a new
 connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)': /simple/re
quests/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status
=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con
nection.VerifiedHTTPSConnection object at 0x03563D70>: Failed to establish a new
 connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)': /simple/re
quests/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status
=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con
nection.VerifiedHTTPSConnection object at 0x03563F30>: Failed to establish a new
 connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)': /simple/re
quests/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status
=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con
nection.VerifiedHTTPSConnection object at 0x03563A30>: Failed to establish a new
 connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)': /simple/re
quests/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status
=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.con
nection.VerifiedHTTPSConnection object at 0x03563950>: Failed to establish a new
 connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)': /simple/re
quests/
ERROR: Could not find a version that satisfies the requirement requests (from ve
rsions: none)
ERROR: No matching distribution found for requests

改完镜像后的效果图:

C:\Users\Administrator>pip install requests
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting requests
  Downloading https://mirrors.aliyun.com/pypi/packages/51/bd/23c926cd341ea6b7dd0
b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (
57kB)
     |█████████████████               | 30kB 2.0MB/s eta 0:00:0
     |██████████████████████▌         | 40kB 2.7MB/s eta
     |████████████████████████████    | 51kB 3.4MB/s
     |████████████████████████████████| 61kB 4.1
MB/s
Collecting certifi>=2017.4.17
  Downloading https://mirrors.aliyun.com/pypi/packages/b9/63/df50cac98ea0d5b006c
55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.wh
l (156kB)
     |█████████████████               | 81kB 5.5MB/s eta 0:00:0
     |███████████████████             | 92kB 6.1MB/s eta 0:00
     |█████████████████████           | 102kB 6.8MB/s eta 0
     |███████████████████████         | 112kB 6.8MB/s eta
     |█████████████████████████       | 122kB 6.8MB/s e
     |███████████████████████████     | 133kB 6.8MB/s
     |█████████████████████████████▌  | 143kB 6.8M
     |███████████████████████████████▌| 153kB 6.
     |████████████████████████████████| 163kB 6.
8MB/s
Collecting chardet<3.1.0,>=3.0.2
  Downloading https://mirrors.aliyun.com/pypi/packages/bc/a9/01ffebfb562e4274b64
87b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (13
3kB)
     |████████████████████████▌       | 102kB 6.8MB/s e
     |███████████████████████████     | 112kB 6.8MB/s
     |█████████████████████████████▌  | 122kB 6.8M
     |████████████████████████████████| 133kB 6.
     |████████████████████████████████| 143kB 6.
8MB/s
Collecting idna<2.9,>=2.5
  Downloading https://mirrors.aliyun.com/pypi/packages/14/2c/cd551d81dbe15200be1
cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
     |████████████████████████████████| 61kB ...

Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in d:\pyt
hon\lib\site-packages (from requests) (1.25.3)
Installing collected packages: certifi, chardet, idna, requests
Successfully installed certifi-2019.11.28 chardet-3.0.4 idna-2.8 requests-2.22.0

喜欢的点个赞❤吧!


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
redis redis-2.6.17 安装失败 原因分析
  redis 安装 redis-2.6.17   redis 集群 安装 http://knight-black-bob.iteye.com/blog/2343192       zmalloc.
812 0
conda 和 pip 安装本地包
conda 和 pip 安装本地包
59 0
Windows Phone 8初学者开发—第2部分:安装Windows Phone SDK 8.0
原文 Windows Phone 8初学者开发—第2部分:安装Windows Phone SDK 8.0 原文地址:http://channel9.msdn.com/Series/Windows-Phone-8-Development-for-Absolute-Beginners/Part...
1134 0
DNN安装Microsoft SQL Server, Error:15401处理方法
今天在一台域服务器上安装DNN 时,在SQL 2005中添加Network Service账号总是报错: Create failed for Login “ComputerName\NETWORK SERVICE”(Microsoft.
601 0
+关注
649
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
JS零基础入门教程(上册)
立即下载
性能优化方法论
立即下载
手把手学习日志服务SLS,云启实验室实战指南
立即下载