在通过pip安装pandas时报错
pip install pandas
默认情况下pip使用国外镜像,在下载非常慢,导致我们安装超时。所以我们需要将镜像源网站设置为国内的镜像源。
常用的国内镜像源有如下几个:
- 阿里云 http://mirrors.aliyun.com/pypi/simple/
- 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
- 豆瓣(douban) http://pypi.douban.com/simple/
- 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
- 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
通过命令永久更换镜像源网站,以清华大学为例:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
查看配置是否变更成功
pip config list
发现已成功变更为清华大学的镜像源网站啦
重新执行安装命令,安装成功!!!