Using pip behind a proxy with CNTLM

前端 未结 30 2232
囚心锁ツ
囚心锁ツ 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:34

    Set the following environment variable: export PIP_PROXY=http://web-proxy.mydomain.com

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

    This worked for me (on Windows via CMD):

    pip install --proxy proxyserver:port requests
    
    0 讨论(0)
  • 2020-11-22 11:37

    In Windows 7:

    pip install --proxy DOMAIN\user:password@proxyaddress:port package
    

    i.e.:

    pip install --proxy BR\neo:p4ssw0rd@myproxyrocks.com.br:8080 virtualenv
    
    0 讨论(0)
  • 2020-11-22 11:37

    This is what works for me:

    pip --proxy proxy url:port command package
    
    0 讨论(0)
  • 2020-11-22 11:37

    If you are using Linux, as root:

    env https_proxy=http://$web_proxy_ip:$web_proxy_port pip install something
    

    When you use env it exports the variable https_proxy for the current execution of the command pip install.

    $web_proxy_ip is the hostname or IP of your Proxy $web_proxy_port is the Port

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

    Under our security policy I may not use https with pypi, SSL-inspection rewrites certificates, it breaks the built-in security of pip for www.python.org. The man in the middle is the network-admin.

    So I need to use plain http. To do so I need to override the system proxy as well as the default pypi:

    bin/pip install --proxy=squidproxy:3128 -i http://www.python.org/pypi --upgrade "SQLAlchemy>=0.7.10"
    
    0 讨论(0)
提交回复
热议问题