首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python警告:正在重试(Retry(total=4,connect=None,read=None,redirect=None,status=None))

Python警告:正在重试(Retry(total=4,connect=None,read=None,redirect=None,status=None))
EN

Stack Overflow用户
提问于 2021-05-15 21:23:06
回答 2查看 4.7K关注 0票数 3

我在试着做pip install --upgrade pip并保持

获取此错误:

代码语言:javascript
复制
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnection
Error('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026F50B448C8>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it'))': /simple/pytest/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnection
Error('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026F50B59148>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it'))': /simple/pytest/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnection
Error('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026F50B596C8>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it'))': /simple/pytest/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnection
Error('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026F50B595C8>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it'))': /simple/pytest/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnection
Error('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026F50B5F2C8>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it'))': /simple/pytest/
ERROR: Could not find a version that satisfies the requirement pytest
ERROR: No matching distribution found for pytest

另外,由于这个错误,我不能安装任何新的包。

我尝试重新安装Pycharm,但没有成功。

我在网上尝试了一些其他建议的解决方案-仍然没有成功。

我知道它与代理有关,但我不熟悉它,任何人?

EN

回答 2

Stack Overflow用户

发布于 2021-11-06 14:28:08

尝试将构建命令附加到--network=host

例如:docker build -t cointainer_name . --network=host

代码语言:javascript
复制
If you use the host network mode for a container, that container’s network stack is not isolated from the 
Docker host (the container shares the host’s networking namespace), and the container does not 
get its own IP-address allocated. 
For instance, if you run a container which binds to port 80 and you use host 
networking, the container’s application is available on port 80 on the host’s IP address.

请查看here了解更多详细信息

票数 2
EN

Stack Overflow用户

发布于 2022-02-09 14:13:23

首先,重新安装所有的python。其次,一旦安装了python,我就找到了host文件,并取消了host部分的注释。通常,windows中的路径位于C:\Windows\System32\drivers\etc

取消对此部分的注释:

本地主机名称解析在DNS本身中处理。

代码语言:javascript
复制
127.0.0.1       localhost
::1             localhost

希望它能起作用!干杯!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67547176

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档