python pip 代理设置
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 代理设置的更多相关文章
- pip 代理设置,坑爹的代理继续
Linux ubuntu 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Lin ...
- python pip下载设置
安装命名为 pip install -i 网址 所需要安装的库名例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests ...
- [python]通过urllib2设置代理访问网址
#!/usr/bin/env pythonimport urllib2 # change followings before useuser = 'foo'passwd = 'bar'proxyser ...
- 为 pip install 设置 socks5 代理
参考 How to use pip with socks proxy? 为 pip install 设置 socks5 代理 设置方法: pip install pysocks pip install ...
- python + seleinum +phantomjs 设置headers和proxy代理
python + seleinum +phantomjs 设置headers和proxy代理 最近因为工作需要使用selenium+phantomjs无头浏览器,其中遇到了一些坑,记录一下,尤 ...
- 设置pip代理
参考: python-proxy-for-pip 设置pip代理 pip install -i http://pypi.douban.com/simple xxx 2018.4
- Python基础 - eazy_install和pip源设置
在国内一般推荐豆瓣的源,虽然工作中用到的都是公司内部的源,出于安全考虑这里就不拿公司的源举例了~ 1. pip源设置 打开~/.pip/pip.conf文件,若文件不存在则创建文件或者直接mkdir ...
- 人性化的Requests模块(响应与编码、header处理、cookie处理、重定向与历史记录、代理设置)
Requests库是第三方模块,需要额外进行安装.Requests是一个开源库 pip install requests 去GitHub下载回来,进入解压文件,运行setup.py 比urllib2实 ...
- http错误和异常处理,认证和代理设置
http错误: import urllib.requestreq = urllib.request.Request('http://www.python.org/fish.html')try:urll ...
随机推荐
- deno学习二 基本代码
deno 介绍是安全的ts 运行时 简单的代码 使用js(app.js) console.log("demoapp") 输出 dalongdemo 使用ts(app.ts) con ...
- php non-thread-safe和thread-safe这两个版本有何区别?
php non-thread-safe和thread-safe这两个版本有何区别? non-thread-safe 非线程安全 与IIS 搭配环境thread-safe 线程安全 与apache 搭配 ...
- Mysql安装过程中出现apply security settings错误的解决方法
在学习Mysql的过程中,首先要安装Mysql.然而在第一遍安装过程中难免会出现安装错误的时候,当卸载后第二次安装(或者第三次甚至更多次)的时候,往往在安装最后一步会出现apply security ...
- [转][C#]压缩解压缩类 GZipStream
本文来自:https://msdn.microsoft.com/zh-cn/library/system.io.compression.gzipstream(v=vs.100).aspx using ...
- py基础3--函数,递归,内置函数
本节内容 函数基本语法及特性 参数与局部变量 返回值 嵌套函数 递归 匿名函数 函数式编程介绍 高阶函数 内置函数 1. 函数基本语法及特性 背景提要 现在老板让你写一个监控程序,监控服务器的系统状况 ...
- Android TextView(EditView)文字底部或者中间 加横线
Android TextView(EditView)文字底部或者中间 加横线 tv = (TextView) this .findViewById(R.id. text_view ); 中间加横线 t ...
- win10初期版本administrator的限制
win10初期版本administrator的限制,很多功能administrator用户无法使用如应用商店等等,在目前的新版本,差不多都可以使用了.
- 告诉你C盘里的每个文件夹都是干什么用的 ! ! !
Documents and Settings是什么文件? 答案: 是系统用户设置文件夹,包括各个用户的文档.收藏夹.上网浏览信息.配置文件等. 补:这里面的东西不要随便删除,这保存着所有用户的文档 ...
- C关系运算结果及逻辑运算结果保存
http://service.exmail.qq.com/
- 利用 Babel 玩转你的代码
我在团队帮助开发 Node 工具时,遇到了需要对多份相似的代码进行一定的处理,但又不能改变原本仓库的代码,这个非常像我们的编译工具做的事情.在一开始的时候,参考了类似 FIS 的功能,简单参照使用代码 ...