Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install failing with 407 Proxy Authentication Required

I am trying to use the below pip install command, but its failing with Proxy authentication required issue. I have already configured my proxies inside my RHEL7.x Server.

Command Used: `pip install --proxy https://'username:pwd'@proxy:host  --upgrade pip`

Logs:

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
like image 969
Manigandan Thanigai Arasu Avatar asked Sep 28 '17 09:09

Manigandan Thanigai Arasu


People also ask

How do I fix 407 proxy authentication required?

-Click the Windows "Start" button on your proxy server. -Click "Administrative Tools" and then click "Internet Information Services Manager." The IIS utility loads and all of your websites and proxy server settings are shown. -On the next screen enable "Anonymous Authentication".

How do I get Pip to work behind a proxy server?

pip can be configured to connect through a proxy server in various ways: using the --proxy command-line option to specify a proxy in the form scheme://[user:passwd@]proxy.server:port. using proxy in a Configuration Files. by setting the standard environment-variables http_proxy , https_proxy and no_proxy .


2 Answers

This is the first thing you should try:

Open the command prompt(CMD).

Export the proxy settings :

:\set http_proxy=http://username:password@proxyAddress:port

:\set https_proxy=https://username:password@proxyAddress:port

Install the package you want to install:

:\pip install PackageName

like image 123
Nitish Kumar Pal Avatar answered Oct 19 '22 11:10

Nitish Kumar Pal


Error 407 means that the authentication for the proxy is missing / wrong. Remove the ' from the username:pwd part, i.e. use: pip install --proxy https://username:pwd@proxy:host.

Try opening an internet connection from that server just prior to installing the Python package, as another option.

If this is not helping, try the the options given in the answers to the questions here, here and here.

like image 5
bastelflp Avatar answered Oct 19 '22 10:10

bastelflp