pip install 生成警告: 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at ...>

Hen*_*hab 6 python installation pip

我花了很多时间搜索是否有人已经遇到了同样的问题,但我没有找到任何东西。

一段时间以来,每次我想用 pip 安装软件包时都会收到警告。安装最终成功,但需要更多时间。该警告包含重复 5 次相同的 WARNING :

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b71c50>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b6c690>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b6cb90>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105bb6f10>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105bb67d0>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
Run Code Online (Sandbox Code Playgroud)

在这些警告之后,一切似乎都运行良好,但我想删除它们以加快安装速度。

如果您需要更多信息,请随时询问,我不确定应该在哪里挖掘来解决这个问题,所以我不知道需要什么样的信息。

非常感谢您的帮助 !

小智 9

对于使用 Ubuntu20 的 win10 wsl2 和 conda 环境的人:

请先在 conda 中运行以下代码:

sudo apt-get update
sudo apt-get upgrade
sudo apt install python3-pip
Run Code Online (Sandbox Code Playgroud)

然后激活任意conda环境,pip install就可以成功运行。


小智 -3

我能够将其安装为 su。'sudo su' ,然后 pip3 install sele