(1)在/root/目录下创建 .pip 文件夹与 pip.conf 文件
[root@devops ~]# cd ~
[root@devops ~]# mkdir .pip
[root@devops ~]# vim pip.conf
(2)编辑pip.conf文件
## 添加如下内容,设置pip源为阿里云源
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
## :wq!保存退出即可