Using pip behind a proxy with CNTLM

前端 未结 30 2253
囚心锁ツ
囚心锁ツ 2020-11-22 11:00

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

相关标签:
30条回答
  • 2020-11-22 11:40

    I had the same issue : behind a corporate proxy with auth at work, I couldn't have pip work, as well as Sublime Text 2 (well, it worked with custom setup of my proxy settings). For pip (and I'll try that on git), I solved it installing cntlm proxy. It was very simple to configure :

    1. Edit cntlm.ini
    2. Edit "Username", "Domain", "Password" fields
    3. Add a "Proxy" line, with your proxy settings : server:port
    4. Make sure the line "NoProxy" integrates "localhost" (like that by default)
    5. Note the default port : 3128
    6. Save and that's it.

    To test that works, just launch a new command line tool, and try :

    pip install django --proxy=localhost:3128
    

    That worked for me. Hope this will help you.

    0 讨论(0)
  • 2020-11-22 11:41

    for windows; set your proxy in command prompt as
    set HTTP_PROXY=domain\username:password@myproxy:myproxyport

    example:
    set http_proxy=IND\namit.kewat:xl123456@192.168.180.150:8880

    0 讨论(0)
  • 2020-11-22 11:41

    I solved the problem with PIP in Windows using "Fiddler" (https://www.telerik.com/download/fiddler). After downloading and installing, do the following:

    "Rules" => click "Automatically Authenticate"

    Example: pip install virtualenv -proxy 127.0.0.1:8888

    Just open your prompt and use.

    https://github.com/pypa/pip/issues/1182 Search for "voltagex" (commented on 22 May 2015)

    0 讨论(0)
  • 2020-11-22 11:42

    In Ubuntu 14.04 LTS

       sudo pip --proxy http://PROXYDOM:PROXYPORT install package
    

    Cheers

    0 讨论(0)
  • 2020-11-22 11:42

    I am also no expert in this but I made it work by setting the all_proxy variable in the ~/.bashrc file. To open ~/.bashrc file and edit it from a terminal run following commands,

    gedit ~/.bashrc &
    

    Add following at the end of file,

    export all_proxy="http://x.y.z.w:port"
    

    Then either open a new terminal or run following in the same terminal,

    source ~/.bashrc
    

    Just setting http_proxy and https_proxy variables aren't enough for simple usage pip install somepackage. Though somehow sudo -E pip install somepackage works, but this have given me some problem in case I am using a local installation of Anaconda in my users' folder.

    P.S. - I am using Ubuntu 16.04.

    0 讨论(0)
  • 2020-11-22 11:45

    Under Windows dont forget to set

    SET HTTPS_PROXY=<proxyHost>:<proxyPort>
    

    what I needed to set for

    pip install pep8
    
    0 讨论(0)
提交回复
热议问题