Python 程序包镜像的国内源如下:
- 清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/
- 豆瓣(douban): https://pypi.douban.com/simple/
- 阿里云: https://mirrors.aliyun.com/pypi/simple/
- 中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
使用方法:pip install -i 镜像源 包名
比如我要安装requests库,则可以在Terminal控制台执行下面命令
pip install --index https://pypi.mirrors.ustc.edu.cn/simple requests
我们也可以直接修改默认的镜像源,比如将系统默认镜像源设置为清华源,在控制台输入下面命令
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple