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
Cleaning up...
No distributions at all found for requests
Storing debug log for failure in /root/.pip/pip.log
Exporting 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 requests
:
sudo pip --proxy http://proxy.hell:3128 install requests
The same solution applies to pip3 as well.
'sudo' is not recognized as an internal or external command,
operable program or batch file.
Am also getting timeout
'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/py2exe/
ERROR: Could not install packages due to an EnvironmentError: Failed to parse: https://genproxy:8080
I have used the following command for installation of package:
Say for example:
sudo pip3 install --proxy=proxy.honeywell.com:8080 pyodbc
sudo yum install --proxy=proxy.honeywell.com:8080 python3-pip