pip在主机计算机中安装库时出现的问题

2024-04-19 23:33:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在我的macosx(Python2.7.10)中使用pip(9.0.1),但每当我安装某个东西时,总是会出现以下错误:

Collecting flask
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b8fa310>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/flask/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b8fa110>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/flask/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b8fa550>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/flask/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b8fa850>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/flask/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b8facd0>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/flask/

有人提到这可能与防火墙有关,所以我通过手机连接到网络,然后执行pip,在这种情况下,似乎安装了一些东西,但在下载每个软件包之前,我仍然会“重试”,比如:

^{pr2}$

知道我为什么收到这些信息吗?在


Tags: pipnoneflaskreadbyconnectconnectionredirect
1条回答
网友
1楼 · 发布于 2024-04-19 23:33:59

pip有proxy选项。请使用它。在

pip install flask  proxy=<proxy address>

来自pip help

proxy Specify a proxy in the form [user:passwd@]proxy.server:port.

阅读代理地址here。在

请参阅this在mac os上安装代理。在

相关问题 更多 >