How to use pip on windows behind an authenticating proxy

前端 未结 9 1242
谎友^
谎友^ 2020-11-28 19:23

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).

9条回答
  •  北海茫月
    2020-11-28 20:11

    install cntlm: Cntlm: Fast NTLM Authentication Proxy in C

    Config cntlm.ini:

    Username ob66759

    Domain NAM

    Password secret

    Proxy proxy1.net:8080

    Proxy proxy2.net:8080

    NoProxy localhost, 127.0.0.*, 10.*, 192.168.*

    Listen 3128

    Allow 127.0.0.1

    #your IP

    Allow 10.106.18.138

    start it:

    cntlm -v -c cntlm.ini

    Now in cmd.exe:

    pip install --upgrade pip --proxy 127.0.0.1:3128

    Collecting pip
      Downloading https://files.pythonhosted.
    44c8a6e917c1820365cbebcb6a8974d1cd045ab4/
    
        100% |███████████████████████████████
    Installing collected packages: pip
      Found existing installation: pip 9.0.1
        Uninstalling pip-9.0.1:
          Successfully uninstalled pip-9.0.1
    
    Successfully installed pip-10.0.1
    

    works!

    You can also hide password: https://stormpoopersmith.com/2012/03/20/using-applications-behind-a-corporate-proxy/

提交回复
热议问题