How to configure PIP per config file to use a proxy (with authentification)?

孤街浪徒 提交于 2019-12-03 01:13:40

Here are the steps how to configure proxy (with auth.) in pip's config file (pip.ini)

  1. (if it does not already exist) Create a folder named 'pip' and inside it a file named 'pip.ini' as described here: https://pip.pypa.io/en/stable/user_guide/#config-file (location an name may differ per platform - e.g. on Windows it's %APPDATA%\pip\pip.ini)
  2. edit pip.ini file and add

    [global]
    proxy = http://user:password@proxy_name:port
    
  3. That's it!

Example for proxy with authentification (user + password):

proxy = http://butch:secret@proxyname:1234

proxyname can be an IP adress, too

Example for proxy without auth.:

proxy = http://proxyname:1234

crunchyminion

In order to add a proxy option in the terminal the following line solved the problem for me:

pip install package_name_here --proxy https://user_name:password@proxyname:port
Kishore Kolla

You need to set proxy option while installing the package. example:

pip install --proxy userid:password@proxy.domain.com:yourport
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!