使用国内豆瓣源

1、配置文件

编辑配置文件 ~/.pip/pip.conf,添加内容如下:

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

2、命令行选项

使用 pip 命令安装扩展包时指定源:

pip install -i https://pypi.doubanio.com/simple DBUtils

原文地址:https://www.cnblogs.com/lee-xingxing/p/10909774.html