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

原因是Python中xlrd模块 2.0.1 版本不支持.xlsx

Python无法打开.xlsx文件:xlrd.biffh.XLRDError: Excel xlsx file; not supported_另存为

解决方案1.

  1. 卸载已安装的xlrd-2.0.1,安装低版本的xlrd-1.2.0
pip uninstall xlrd
pip install xlrd==1.2.0

解决方案2.

  1. test.xlsx文件另存为xls 文件
    注意不能直接修改test.xlsx文件的后缀名,不然还是读取不出来

今天学会了个新技能其实有时候报错,可以先查源码

Python无法打开.xlsx文件:xlrd.biffh.XLRDError: Excel xlsx file; not supported_解决方案_02

在查官方文档

官网说明

Python无法打开.xlsx文件:xlrd.biffh.XLRDError: Excel xlsx file; not supported_解决方案_03


xlrd 2.0.1 版本

Python无法打开.xlsx文件:xlrd.biffh.XLRDError: Excel xlsx file; not supported_python_04


xlrd 1.2.0 版本

Python无法打开.xlsx文件:xlrd.biffh.XLRDError: Excel xlsx file; not supported_python_05