博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python pip源配置
阅读量:4325 次
发布时间:2019-06-06

本文共 2393 字,大约阅读时间需要 7 分钟。

pipy国内镜像目前有:

    豆瓣

    华中科技大学

    山东理工大学

    中国科学技术大学

 

Win7下配置pip源:

1、在win7用户目录下创建pip目录,以用户user为例:

C:\Users\user\pip

2、在pip目录下新建pip.ini文件:

C:\Users\user\pip\pip.ini

3、配置文件内容:

以下是一个简单的配置示例,供参考:

[global]index-url = http://pypi.douban.com/simpletrusted-host = pypi.douban.comdisable-pip-version-check = truetimeout = 120[install]ignore-installed = trueno-dependencies = yes

 

Linux系统配置pip源:

1、创建~/.pip/pip.conf

2、pip.conf配置内容同win7,如下:

[global]index-url = http://pypi.douban.com/simpletrusted-host = pypi.douban.comdisable-pip-version-check = truetimeout = 120[install]ignore-installed = trueno-dependencies = yes

 

virtualenv下配置pip源:

1、在virtualenv目录下创建env/pip.conf

2、pip.conf内容同Linux,不再赘述。

 

手动指定pip源:

pip install -i http://
/simple

例如:

pip install -i http://pypi.douban.com/simple simplejson

 

只要pip命令中出现的选项都可以配置在配置文件中,比如直接输入pip命令,会提示以下选项,那么这些选项都可以写在配置文件中:

General Options:  -h, --help                  Show help.  --isolated                  Run pip in an isolated mode, ignoring                              environment variables and user configuration.  -v, --verbose               Give more output. Option is additive, and can be                              used up to 3 times.  -V, --version Show version and exit. -q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels). --log 
Path to a verbose appending log. --proxy
Specify a proxy in the form [user:passwd@]proxy.server:port. --retries
Maximum number of retries each connection should attempt (default 5 times). --timeout
Set the socket timeout (default 120.0 seconds). --exists-action
Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort. --trusted-host
Mark this host as trusted, even though it does not have valid or any HTTPS. --cert
Path to alternate CA bundle. --client-cert
Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. --cache-dir
Store the cache data in
. --no-cache-dir Disable the cache. --disable-pip-version-check Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.

可根据需要自行添加。

转载于:https://www.cnblogs.com/xiaoerlang/p/6592232.html

你可能感兴趣的文章
阶段3 3.SpringMVC·_07.SSM整合案例_07.ssm整合之编写MyBatis框架测试保存的方法
查看>>
阶段3 3.SpringMVC·_06.异常处理及拦截器_7 SpringMVC拦截器之拦截器接口方法演示
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_09.ssm整合之Spring整合MyBatis框架配置事务
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_02.ssm整合之搭建环境
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_3、快速创建SpringBoot应用之手工创建web应用...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_04.ssm整合之编写SpringMVC框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_5、SpringBoot2.x的依赖默认Maven版本...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_08.ssm整合之Spring整合MyBatis框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_汇总
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_2、SpringBoot2.x依赖环境和版本新特性说明...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_7、开发必备工具PostMan接口工具介绍和使用...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_4、快速创建SpringBoot应用之自动创建web应用...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_8、SpringBoot基础HTTP接口GET请求实战...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_6、SpringBoot2.xHTTP请求配置讲解...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_10、常用json框架介绍和Jackson返回结果处理...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_9、SpringBoot基础HTTP其他提交方法请求实战...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_12、SpringBoot2.x文件上传实战...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_11、SpringBoot2.x目录文件结构讲解...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第三节SpringBoot热部署devtool和配置文件自动注入实战_15、SpringBoot2.x配置文件讲解...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_13、jar包方式运行web项目文件上传和访问...
查看>>