Loading

pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported

原因是最近xlrd更新到了2.0.1版本,只支持.xls文件。所以pandas.read_excel(‘xxx.xlsx’)会报错。

可以安装旧版xlrd,在cmd中运行:

pip uninstall xlrd
pip install xlrd==1.2.0

也可以用openpyxl代替xlrd打开.xlsx文件:

df=pandas.read_excel(‘data.xlsx’,engine=‘openpyxl’)

原文链接:https://blog.csdn.net/weixin_44073728/article/details/111054157

posted @ 2021-02-26 17:27  DuKe渡客  阅读(393)  评论(0编辑  收藏  举报