首页 > 解决方案 > pip intall pytest 产生 NewConnectionErrors

问题描述

我在远程服务器上(需要企业 VPN 访问才能通过 ssh 连接到远程服务器)。我在 conda 环境(在我的情况下为 pytorch)中工作,需要安装 pytest。我尝试了该命令pip3 install pytest,但不断收到以下错误:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f7d39a10250>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/pytest/

我在Python pip中看到了一个相关问题, 在安装库时引发了 NewConnectionError,并按照接受的答案建议添加nameserver 8.8.8.8到 /etc/resolv.conf 文件中,但它没有解决我的问题。

有人可以建议吗?

我怀疑这与我的 VPN 有关。我无法关闭 VPN,否则它会断开我与正在处理的远程服务器的连接。

标签: pythonpippytest

解决方案


推荐阅读