永久修改 Linux pip国内源
一些常用的国内源
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:https://mirrors.aliyun.com/pypi/simple 中国科学技术大学 https://pypi.mirrors.ustc.edu.cn/simple 豆瓣:http://pypi.douban.com/simple
永久修改pip 国内源
在用户根目录(~,而非系统根目录 / )下添加配置~/.pip/pip.conf目录添加可信源,如果目录文件不存在,可直接创建。
[root@localhost ~]# cd [root@localhost ~]# mkdir .pip [root@localhost ~]# cd .pip [root@localhost .pip]# vim pip.conf
pip.conf 写入如下内容
[global] index-url=http://pypi.douban.com/simple trusted-host = pypi.douban.com
加上trusted-host防止pip报警告