7

I tried to pip install using proxy, the proxy setting is correct because it works for npm install . what i tried is as below shown but got error message. any idea will be more than welcome!

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
stewchicken
  • 411
  • 1
  • 5
  • 15

3 Answers3

8
pip install packageName --proxy proxy_Server:portnumber

ex: pip install numpy --proxy https://myproxy@myserver.com:9090
Surya Tej
  • 1,132
  • 1
  • 11
  • 21
2

From https://stackoverflow.com/a/33611028/2653663 it looks like it should be

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

So port instead of ip.

user2653663
  • 2,708
  • 1
  • 16
  • 22
0

set http_proxy=... and set https_proxy=.... should be enough if the proxy works.

Please run the following command to make sure that it works:

curl https://google.com

enter image description here

Box
  • 2,331
  • 1
  • 16
  • 19