Python 警告:重试(重试(总计=4,连接=无,读取=无,重定向=无,状态=无))

新手上路,请多包涵

我正在尝试做 pip install --upgrade pip 并保持

收到此错误:

 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 但没有成功。

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

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

原文由 Omri 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 641
1 个回答

尝试使用 –network=host 附加构建命令

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

 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.

在这里 查看更多详细信息

原文由 cryptoKTM 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题