例如,使用清华大学镜像:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
如果要一次性一劳永逸解决, 修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
注意: simple 不能少, 是 https 而不是 http
常用的镜像有:
具体见:修改镜像