簡體   English   中英

通過代理pip安裝包

[英]pip install package via proxy

我嘗試使用代理進行 pip install,代理設置是正確的,因為它適用於 npm install 。 我嘗試的是如下所示,但收到錯誤消息。 任何想法都非常受歡迎!

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
pip install packageName --proxy proxy_Server:portnumber

ex: pip install numpy --proxy https://myproxy@myserver.com:9090

https://stackoverflow.com/a/33611028/2653663看起來應該是

set https_proxy=<domain><username>:<password>@<proxy_server>:<port>

所以端口而不是ip。

set http_proxy=...set https_proxy=... 如果代理有效,應該就足夠了。

請運行以下命令以確保它有效:

curl https://google.com

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM