首页 > 其他 > 详细

安装pip源

时间:2017-05-04 14:18:52      阅读:322      评论:0      收藏:0      [点我收藏+]

国内源地址:

豆瓣(douban) http://pypi.douban.com/simple/ 
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

临时使用命令:

pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

备注:把web.py 改成你要这的软件名称

临时使用源python脚本:

#!/usr/bin/python
import os
package = raw_input("Please input the package which you want to install!\n")
command = "pip install %s -i http://pypi.mirrors.ustc.edu.cn/simple --trusted-host pypi.mirrors.ustc.edu.cn" % package
os.system(command)

linux和windows配置成默认的源的方法:

存放在root目录下:

[root@jumpserver pip]# pwd
/root/pip

[root@jumpserver pip]# ll
total 4
-rw-r--r-- 1 root root 52 May  4  2017 pip.conf

内容:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

windows系统:在%HOMEPATH%\pip\pip.ini

内容:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

 

安装pip源

原文:http://www.cnblogs.com/nulige/p/6806552.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!