python pip 代理设置

Posted Jonky

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python pip 代理设置相关的知识,希望对你有一定的参考价值。

pip install --proxy="user:[email protected]: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:[email protected]:port" yourpackage

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

#for linux / unix
export http_proxy="user:[email protected]:port"
export https_proxy="user:[email protected]:port"
export ftp_proxy="user:[email protected]:port"

#windows
set HTTP_PROXY="user:[email protected]:port"
set HTTPS_PROXY="user:[email protected]:port"
set FTP_PROXY="user:[email protected]:port"

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









以上是关于python pip 代理设置的主要内容,如果未能解决你的问题,请参考以下文章

[Python]Pip换源以及设置代理

Python 镜像源设置与代理

如何让 pip 在代理服务器后面工作 [重复]

scrapy按顺序启动多个爬虫代码片段(python3)

python更新pip报错pip._vendor.urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None(示例代码

linux为不能上网的服务器设置代理,pip,wget,conda...