Add support for NTLM proxies
See original GitHub issuePip doesn’t work—it times out—in my office because our computers are behind an evil proxy. It still doesn’t work even after specifying the http_proxy environment variable per http://docs.python.org/2/library/urllib.html
The problem is the proxy uses a proprietary technology called NTLM that urllib
(or whatever http client Pip uses) can’t cope with https://en.wikipedia.org/wiki/NTLM
This problem isn’t peculiar to Pip–other Python and Ruby and Nodejs break too–but the problem is fatal to Pip users. Python’s strength is its great libraries (Numpy, Beautiful Soup, Pandas and so on). Behind a NTLM proxy, these are inaccessible and Python development essentially impossible.
On my computer, I’ve installed all these packages from source (T-E-D-I-O-U-S), but that doesn’t help my colleagues when I send them a ‘handy ten line Python script’. It fails with an import error. We spend a quarter of an hour installing the dependency chain from source. Oh, they say, I heard Python was easy to use.
Maybe these libraries could help https://code.google.com/p/python-ntlm/ https://github.com/requests/requests-ntlm
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:54 (16 by maintainers)
Top GitHub Comments
Ping on this issue.
Windows users, you may be able to make this work by installing Fiddler and setting it to automatically authenticate.
Your local proxy setting then becomes http://localhost:8888
I have pinged a couple of people at MS about availability of proxies for testing
For what it’s worth, my
cntlm.ini
is as follows (all security-sensitive data blanked out):As you can see, basically everything is default (the “
Gateway yes
” setting is something I added recently when experimenting with docker - pip works fine whether it’s there or not).I have environment variables:
I also have
in my
pip.ini
, but I believe the environment variables take precedence. If I remove the environment variables, though, pip still works (presumably because of thepip.ini
setting).I use this daily, and have for a number of years. Whatever the issues people are having on this thread, I can confirm they are not affecting me. I’m no longer using the ISA firewall client I was using back in 2014 when I last commented on this thread - I’ve been using cntlm for some time now.
I’m not trying to claim that the people commenting here are not experiencing this issue, but if there’s any hope of confirming that there’s a problem in pip and getting it fixed, we’re going to need someone to provide a reproducible test case that will allow us to see the problem first hand. And yes, that’s hard as it needs an NTLM proxy set up somewhere accessible on the internet - maybe someone can build an environment somewhere like Appveyor? I don’t know. Or if someone experiencing the issue can dive into the pip code and find a solution they can submit as a PR, we can test it doesn’t break other currently-working setups, and assuming it’s good, merge it.
Otherwise we’re going to have to continue to assume it’s an issue somewhere in the way cntlm or the NTLM proxy it’s interfacing to, are configured.
@iyanmv Just saw your last comment - that’s very interesting. I can’t help in terms of what differences there might be between your two environments except to say “pip has basically no differences in how it works on Windows and Linux”, but it does clearly indicate that there’s something environmental involved in this issue… (Could it be something as simple as differing CNTLM versions? I’m using version 0.92.2).