pip 的镜像源
- 清华:https://pypi.tuna.tsinghua.edu.cn/simple/
- 中科大:https://pypi.mirrors.ustc.edu.cn/simple/
- 阿里云:https://mirrors.aliyun.com/pypi/simple/
- 豆瓣:http://pypi.douban.com/simple/
方法:
- 建立
pip.conf
文件,文件地址为:~/.pip/pip.conf
可以使用:gedit ~/.pip/pip.conf
构建 - 在新建的文件中写入如下信息:
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com
说明:
如果不想修改默认的下载源,每次使用pip下载时也可以单独指定下载源:
pip install your_package_name -i http://pypi.douban.com/simple