bash
[root@localhost ~]# mkdir ~/.pip
[root@localhost ~]# echo '[global]' >> ~/.pip/pip.conf
[root@localhost ~]# c1="index-url=https://"
[root@localhost ~]# c2="mirrors.aliyun.com/pypi/simple"
[root@localhost ~]# echo "${c1}${c2}" >> ~/.pip/pip.conf
> 豆瓣源: `https://pypi.douban.com/simple/\`
> 阿里源: `https://mirrors.aliyun.com/pypi/simple\`
验证
安装一个增强版的解释器ipython用于测试
bash
[root@localhost ~]# pip3 install ipython
安装完成
安装新的pip