pip install failing with 407 Proxy Authentication Required

Manigandan Thanigai Arasu picture Manigandan Thanigai Arasu · Sep 28, 2017 · Viewed 51.8k times · Source

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/

Answer

Nitish Kumar Pal picture Nitish Kumar Pal · Feb 22, 2018

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