目前好用的是清华大学的镜像源,库索引源地址为:https://pypi.tuna.tsinghua.edu.cn/simple 。
使用方法有两种:
命令行方式(临时模式)
$ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
其中,参数 -i 代表库索引源链接地址,后面的URL即为清华大学镜像源链接。
配置文件方式(永久模式)
$ mkdir ~/.pip/
$ touch ~/.pip/pip.conf
$ vim ~/.pip/pip.conf
pip.conf 的文件内容编辑如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
保存后,再次运行pip,搜索和安装库文件的URL地址都将改为清华大学pip镜像源服务器,实测速度理想!见下图: