码迷,mamicode.com
首页 > 编程语言 > 详细

python pip 代理设置

时间:2018-12-21 15:20:17      阅读:428      评论:0      收藏:0      [点我收藏+]

标签:password   ddr   packages   xixi   ant   htm   diff   nta   name   

pip install --proxy="user:password@server:port" packagename

origin url:
http://xiuxixiuxi.blogspot.jp/2013/04/how-to-install-packages-with.html

There are two easy way to install packages for python (regardless of the platform you‘re using), namely easy_install and pip. The later is actually an overlay on the former.

They work very nicely, except with pesky proxies. Both of them have the ability to download through proxy, but they use different syntax.

For pip you will simply add the option ‘--proxy‘ to indicate the proxy address like so:
pip install --proxy="user:password@server:port" yourpackage

Whereas easy_install will rely on environment variables, http_proxy, https_proxy , ftp_proxy

#for linux / unix
export http_proxy="user:password@server:port"
export https_proxy="user:password@server:port"
export ftp_proxy="user:password@server:port"

#windows
set HTTP_PROXY="user:password@server:port"
set HTTPS_PROXY="user:password@server:port"
set FTP_PROXY="user:password@server:port"

If you want those settings to persist, don‘t forget to add them to your bashrc, or through your windows settings

python pip 代理设置

标签:password   ddr   packages   xixi   ant   htm   diff   nta   name   

原文地址:https://www.cnblogs.com/jonky/p/10155518.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!