Mac OX 设置pip国内镜像,下载速度超快

要安装Django,几KB的速度慢吞吞下了好几分钟,最后还下载失败了。于是Google设置pip国内镜像的方法,很快搞定,后面几秒就下完Django了。

在终端进入目录: cd ~/.pip/
如果没有 .pip 文件夹,那就新建文件夹: mkdir .pip
在.pip 文件夹内新建一个文件 > pip.conf
然后打开文件:open pip.conf(会用默认软件打开)

把下面阿里云的镜像地址粘贴到文件里,保存关闭,享受高速下载吧。

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

其他镜像:

豆瓣

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

清华大学

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

    原文作者:银河星海
    原文地址: https://www.jianshu.com/p/e993bdfff7b3
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞