I am trying to use pip behind a proxy at work.
One of the answers from this post suggested using CNTLM. I installed and configured it per this other post, but runnin
If I have much trouble finding a way through the corporate proxy, I connect to the web through my phone (wireless hotspot if I have wifi, USB tether if not) and do a quick pip install
.
Might not work for all setups, but should get most people by in a pinch.
Using pip behind a work proxy with authentification, note that quotation is required for some OSes when specifing the proxy url with user and password:
pip install <module> --proxy 'http://<proxy_user>:<proxy_password>@<proxy_ip>:<proxy_port>'
Documentation: https://pip.pypa.io/en/stable/user_guide/#using-a-proxy-server
Example:
pip3 install -r requirements.txt --proxy 'http://user:password@192.168.0.1:1234'
Example:
pip install flask --proxy 'http://user:password@192.168.0.1:1234'
Proxy can also be configured manually in pip.ini. Example:
[global]
proxy = http://user:password@192.168.0.1:1234
Documentation: https://pip.pypa.io/en/stable/user_guide/#config-file
$ pip --proxy http://proxy-host:proxy-port install packagename
This is what worked for me on
Open the Windows command prompt.
Set proxy environment variables.
set http_proxy=http://user:password@proxy_ip:port
set https_proxy=https://user:password@proxy_ip:port
Install Python packages using proxy in the same Windows command prompt.
pip install --proxy="user:password@proxy_ip:port" package_name
I could achieve this by running:
pip install --proxy=http://user:pass@your.proxy.com:3128 package==version
I'm using Python 3.7.3 inside a corporative proxy.
if you want to upgrade pip by proxy, can use (for example in Windows):
python -m pip --proxy http://proxy_user:proxy_password@proxy_hostname:proxy_port insta
ll --upgrade pip