My computer is running windows behind a proxy on a windows server (using active directory), and I can't figure out how to get through it with pip
(in python3). I have tried using --proxy
, but it still just timeouts. I have also tried setting a long timeout (60s), but that made no difference. My proxy settings are correct, and I compared them with those that I'm using successfully in TortoiseHG to make sure.
Are there any other tricks that anyone knows of that I can try, or is there some limitation in pip
with regards to windows proxies?
Update: My failed attempts involved searching pypi. I've just tried actually installing something and it worked. Searching still fails though. Does this indicate a bug in pip
or do they work differently?
It took me a couple hours to figure this out but I finally got it to work using CNTLM and afterwards got it to work with just a pip config file. Here is how I got it work with the pip config file...
Solution:
1. In Windows navigate to your user profile directory (Ex. C:\Users\Sync) and create a folder named "pip"
2. Create a file named "pip.ini" in this directory (Ex. C:\Users\Sync\pip\pip.ini) and enter the following into it:
Replace [domain name], [username], [password], [proxy address] and [proxy port] with your own information.
3. At this point I was able to run "pip install" without any issues.
Hopefully this works for others too!
P.S.: This may pose a security concern because of having your password stored in plain text. If this is an issue, consider setting up CNTLM using this article (allows using hashed password instead of plain text). Afterwards set
proxy = 127.0.0.1:3128
in the "pip.ini" file mentioned above.I had the same issue on a remote windows environment. I tried many solutions found here or on other similars posts but nothing worked. Finally, the solution was quite simple. I had to set
NO_PROXY
with cmd :You have to use double quotes and set
NO_PROXY
to upper case. You can also addNO_PROXY
as an environment variable instead of setting it each time you use the console.I hope this will help if any other solution posted here works.
In my case it worked when I opened command prompt (cmd) as an administrator only and no further information about proxy settings was needed.