通过代理安装pip包

2024-05-03 15:39:26 发布

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

我尝试使用代理进行pip安装,代理设置是正确的,因为它适用于npm安装。我尝试的如下所示,但收到错误消息。任何想法都是非常受欢迎的!

set http_proxy=http://<username>:<password>@<proxy_server>:<port>

set https_proxy=https://<username>:<password>@<proxy_server>:<port>

pip install Flask

Collecting Flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))': /simple/flask/
  Could not find a version that satisfies the requirement Flask (from versions: )
No matching distribution found for Flask

Tags: nonereadbystatusconnectconnectionredirectproxy