1.在根目錄下創建.pip文件夾
mkdir ~/.pip
2.在創建好的.pip文件夾下創建pip源配置文件
touch ~/.pip/pip.conf
3.選擇國內某一pip源配置到文件pip.conf中,樣例如下(這里用的是阿里的pip源):
[global] index-url=http://mirrors.aliyun.com/pypi/simple trusted-host=mirrors.aliyun.com
版本2:
[global] timeout = 60 index = http://pip.baidu.com/root/baidu/ index-url = http://pip.baidu.com/root/baidu/simple/ trusted-host = pip.baidu.com [list] format = columns