Join us on Facebook!
— Written by Triangles on January 29, 2016 • updated on June 10, 2016 • ID 27 —
What to do when a proxy server steps on your toes?
I'm working on Debian Stretch with pip 1.5.6. I need to install a new Python module (Requests, the famous http library) but, being behind a nasty proxy, I can't get pip to work properly. This is the error I'm getting so far:
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement requests
No distributions at all found for requests
Storing debug log for failure in /root/.pip/pip.log
https_proxy environment variables as I did in one of my previous articles didn't help. Eventually I found a nice and simple solution: the
--proxy parameter for pip. Use it as follows:
sudo pip --proxy <proxy> install <module>
For example, if the proxy is
http://proxy.hell:3128 and the module you want to install is
sudo pip --proxy http://proxy.hell:3128 install requests
The same solution applies to pip3 as well.