Leif160519的blog Leif160519的blog

——————

目录
pip换源(mac,linux,Windows同样适用)
/        

pip换源(mac,linux,Windows同样适用)

永久换源

在终端进入目录:cd ~/
如果没有 .pip文件夹,那么就要新建这个文件夹:mkdir .pip
然后在.pip文件夹内新建一个文件touch pip.conf
编辑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

或者:

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

临时指定使用某个源:

可以在使用pip的时候在后面加上-i参数,指定pip源

pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

pip国内的一些镜像:

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


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题pip换源(mac,linux,Windows同样适用)
作  者Leif160519
出  处https://github.icu/articles/2019/08/22/1566462724733.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!