更换pip

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

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

Linux

进入配置(如果没有,先新建一个

$ sudo mkdir ~/pip
$ sudo vim ~/pip/pip.conf

无法写入pip.conf

可用下面的命名查看buftype设置,当buftype=nofile时,不能保存文件,只有当buftype=空时,才可以保存

:verbose set buftype 

修改buftype方法vim切换至ex模式输入

:setlocal buftype= 

如果想该回原设置,可用下面的命令

:setlocal buftype=nofile  

修改

内容如下

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

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注