在安装python第三方包时,cmd下载,速度一般比较慢。需要使用镜像改善速度。
1、临时使用镜像
使用清华大学(https://pypi.tuna.tsinghua.edu.cn/simple/)的镜像,下载pandas库。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
2、永久使用镜像
使用清华大学(https://pypi.tuna.tsinghua.edu.cn/simple/)的镜像,下载pandas库。
windows:
① 在C盘下的user目录中,新建一个pip文件夹,在此文件夹中,再新建一个pip.ini文件。如下图所示:
② 打开pip.ini文件,可用sublime text3 打开,写上如下图所示的语句。
[global]
index-url =https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
③在cmd中,输入pip install pandas 时, 就可以看到,镜像已经安排上了。如下图所示。