centos7下python的国内源

操做系统:centos7python

python:2.7.xlinux

国内源:

清华:https://pypi.tuna.tsinghua.edu.cn/simplewindows

阿里云:http://mirrors.aliyun.com/pypi/simple/centos

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ide

华中理工大学:http://pypi.hustunique.com/阿里云

山东理工大学:http://pypi.sdutlinux.org/ url

豆瓣:http://pypi.douban.com/simple/centos7

临时使用:

能够在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。操作系统

永久修改,一劳永逸:

Linux下,修改 ~/.pip/pip.conf (没有就建立一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)code

内容以下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

windows下,直接在user目录中建立一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。

相关文章
相关标签/搜索