欢迎光临散文网 会员登陆 & 注册

【文】Python更换国内镜像源

2020-06-17 01:34 作者:夏末小仙  | 我要投稿


事情的起因是,今天需要安装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

休息去了!


【文】Python更换国内镜像源的评论 (共 条)

分享到微博请遵守国家法律