Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install package via proxy

Tags:

python

pip

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
like image 538
stewchicken Avatar asked Jan 27 '23 14:01

stewchicken


2 Answers

pip install packageName --proxy proxy_Server:portnumber

ex: pip install numpy --proxy https://[email protected]:9090
like image 102
Surya Tej Avatar answered Jan 31 '23 23:01

Surya Tej


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.

like image 37
user2653663 Avatar answered Jan 31 '23 22:01

user2653663