Python Forum
Problem to use pip behind cntlm / corporate proxy
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem to use pip behind cntlm / corporate proxy
#1
Hi,

my problem isn't related to code itself, but to pip. I have to use several pip packages, but have the problem, i can not install them. The following problem:

bash-4.2# echo $http_proxy
10.0.75.1:3128
bash-4.2# echo $https_proxy
10.0.75.1:3128
bash-4.2# curl www.google.de
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="de"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title>... the source of the google landing page ... </script></div></body></html>
so as you can see, cntlm and requests are working fine... then it comes to pip:


bash-4.2# pip install deepdiff
Error:
Collecting deepdiff Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/deepdiff/ Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/deepdiff/ Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/deepdiff/ Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/deepdiff/ Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response',))': /simple/deepdiff/ Could not find a version that satisfies the requirement deepdiff (from versions: ) No matching distribution found for deepdiff
Any ideas? Btw. Python/pip is the only app that wont run behind cntlm.
Reply
#2
did you try to pass --proxy argument to pip?
https://pip.pypa.io/en/stable/reference/...tion-proxy
if it works you can set this in a config file
https://pip.pypa.io/en/stable/user_guide/#config-file
Reply
#3
Hello everyone,

I found this article, https://stormpoopersmith.com/2012/03/20/...rate-proxy, really useful when getting pip install to work behind a corporate firewall that requires an NTLM proxy. But it is still a right pain. And I cannot envisage every developer on my project being willing to go through that pain just so that the pip install command works. So this issue really kills the value of extra python modules.

Does anyone know of any way that pip install can be made to look in alternative repos, maybe behind the corporate firewall? That way the corporation can officially sanction certain oft-used python modules by placing them in this place, then pip install should then pick them up with no problem. Of course if someone comes across a module not made available in this this way then pip install still won't work but at least it can be reported and then made available. Any thoughts? Can it be done?

-Andrew Marlow
Reply
#4
Is it possible to download files directly (without interference from the firewall) from pypi , instead of having pip doing the download. You may be able to use pip to do the install.

For example dowload deepdiff : https://pypi.org/project/deepdiff/#files

pip install deepdish-0.3.6-py2.py3-none-any.whl

Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem Getting Pip To Work Behind Linux Proxy joedirgy 0 1,709 Feb-06-2021, 07:57 PM
Last Post: joedirgy
  Login to Corporate Website tkj80 2 2,771 Aug-15-2018, 02:19 AM
Last Post: tkj80

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020