2

I read many many threads about pip proxy configuration error, and I don't know why mine is still not working.

I am on Fedora 23 and setted up my proxy as follow :

export http_proxy="http://[username:password@]my_proxy:3128/"

(same with https and ftp). It is like this since a long time and I have absolutely no problems to run dnf, wget, curl or w/e.

When I run : pip install -U pip, i get the following error :

File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py", line 231, in __init__
    'Not supported proxy scheme %s' % proxy.scheme
AssertionError: Not supported proxy scheme [proxy_username]

I tried the following commands to :

pip install --proxy="proxy_username:proxy_password@proxy:3128" -U pip

pip install --proxy="http://proxy_username:proxy_password@proxy:3128/" -U pip (tried w/o the ending / too)

pip install --proxy proxy_username:proxy_password@proxy:3128 -U pip

pip install --proxy http://proxy_username:proxy_password@proxy:3128 -U pip

And I still get the same error, over and over.

I tried to comment the line 231 of poolmanager.py, as I saw on a stackoverflow thread, it stills not working, I have the following error :

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/

which is basically the same error as before.

Do you have any clues ?

Thanks.

A new point : I have installed a new Virtual Machine and .... It works. I don't know why, I have entered the exact same command as this : pip install --proxy="http://proxy_username:proxy_password@proxy:3128/" -U pip

It is a problem because I wouldn't like to totally rebuild a new virtual machine ...

Ecterion
  • 161
  • 3
  • 19

2 Answers2

1

Ok so I solved the problem :

I managed to run the commande without any problem on another empty Virtual Machine, where I just used the "export" command for the proxy.

I went back on my main VM and erased each line using "export http_proxy..." in, for example, etc/profile or .bashrc. Next, I did pip install proxy="http://proxy_username:proxy_password@proxy:3128/" and it worked. One of my file had a wrong proxy, I guess pip uses this file to override the proxy you give to hime with the --proxy option.

Ecterion
  • 161
  • 3
  • 19
-1

Just to make sure, all your commands are:

pip install --proxy="proxy_username:proxy_user@proxy:3128" -U pip

pip install --proxy="http://proxy_username:proxy_user@proxy:3128" -U pip

pip install --proxy proxy_username:proxy_user@proxy:3128 -U pip

pip install --proxy http://proxy_username:proxy_user@proxy:3128 -U pip

Or documentation says: http_proxy="http://[username:password@]my_proxy:3128/" username:password, not username:username

Destrif
  • 2,104
  • 1
  • 14
  • 22
  • Please can you try this: export https_proxy=http://proxy_username:proxy_user@proxy:3128 Please note that it's https(Even if it's not) sudo -E pip install somepackage – Destrif May 18 '16 at 12:02