python中国内源_【文】Python更换国内镜像源

事情的起因是,今天需要安装python pandas!使用pip 试了好几次都是下载中断!我裂开!下载一次再次尝试心碎了,不再尝试了!啥也不说了,说多了都是泪!

事情的起因是,今天需要安装python pandas!使用pip 试了好几次都是下载中断!

我裂开!下载一次

再次尝试

心碎了,不再尝试了!

啥也不说了,说多了都是泪!果断采取了换源方案!

0、国内镜像源列表

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

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

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

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

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

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

网易:https://mirrors.163.com/pypi/simple/

中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

1、临时用换源,terminal或者cmd下运行(xxx为你所需安装的模块名)

方式一:pip install xxx  -i https://pypi.tuna.tsinghua.edu.cn/simple

方式二:pip install   -i https://pypi.tuna.tsinghua.edu.cn/simple  xxx

2、永久设置换源

(1)windows:

在C:\Users\xxx(你的管理员用户名)目录下新建pip目录,创建pip.ini文件[global]

index-url= https://pypi.tuna.tsinghua.edu.cn/simple

(2)Linux:

修改~/.pip/pip.conf

[global]

index-url= https://pypi.tuna.tsinghua.edu.cn/simple

就是这样子滴!

下载效果图这速度,简直直接起飞!

最后附上配置视频!

配置完成!有疑问欢迎加q:422119017休息去了!