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 ...
随机推荐
- springboot将项目打成war包
1. 将项目的打包方式改为war包 <groupId>com.cc</groupId> <artifactId>aaaaaa</artifactId> ...
- slot的使用实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- php 自定义函数大全
1. call_user_func和call_user_func_array 以上两个函数以不同的参数形式调用函数.见如下示例: <?php class demo{ public static ...
- VB中Excel 2010的导入导出操作
VB中Excel 2010的导入导出操作 编写人:左丘文 2015-4-11 近来这已是第二篇在讨论VB的相关问题,今天在这里,我想与大家一起分享一下在VB中如何从Excel中导入数据和导出数据到Ex ...
- MySQL锁之二:锁相关的配置参数
锁相关的配置参数: mysql> SHOW VARIABLES LIKE '%timeout%'; +-----------------------------+----------+ | Va ...
- 移动自动化测试:Android Studio 、Appium、夜神模拟器
环境是Window 10 64位 第一章:安装Appium Appium和node.js需要一起安装,他们的依赖关系暂不深究. 1. node.js傻瓜式安装 官网地址:https://nodejs. ...
- 模板引擎文档 - layui.laytpl 介绍
<!DOCTYPE html> <html class="ui-page-login"> <head> <meta charset=&qu ...
- zabbix使用之打造邮件报警
zabbix使用之打造邮件报警 前言: 报警信息很重要,它能使我们最快的知道故障内容,以便于及时处理问题.zabbix如果没配置报警功能,则完全不能体现zabbix的优势了 配置详情如下: 1.编写发 ...
- React基本实例
学习React不是一蹴而就的事情,入门似乎也没那么简单.但一切都是值得的. 今天给大家带来一个详细的React的实例,实例并不难,但对于初学者而言,足够认清React的思考和编写过程.认真完成这个实例 ...
- leetcode58
public class Solution { public int LengthOfLastWord(string s) { s = s.Trim(); || s.Trim().Length == ...