Friday, April 5, 2019

How to Use pip behind a Proxy ?

On Linux

Set up the proxy through

and then install package:

pip install somepackage

or specify proxy in pip command:

sudo pip install --proxy=https://[username:password@]proxyserver:port somepackage

On Windows

You can manually set up proxy environment variables through right-click on This PC (Windows 10)
or Computer (Widnows 7) –> Proporties –> Advanced system settings –> Environment variables
then add environment variables:

You can also set up the proxy through comand lines:

set http_proxy=http://[username:password@]proxyserver:port
set http_proxy=https://[username:password@]proxyserver:port
After setting up proxies, then you can install packages through running:

pip install somepackage
Alternativelly, you can also specify proxy settings in the pip command:

pip install --proxy=https://[username:password@]proxyserver:port somepackage

No comments:

Post a Comment