Pandas讀取XLSX文件錯誤
出自 YTYZX有图有真相的百科
於 2022年4月16日 (六) 17:07 由 2409:8a70:949:9bc0:1168:f384:da3f:b83a (對話) 所做的修訂 (创建页面,内容为“ 1. 使用Pandas读取XLSX文件出现错误。 报错信息:File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\xlrd\__init__.py"...”)
1. 使用Pandas读取XLSX文件出现错误。 报错信息:File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\xlrd\__init__.py", line 170, in open_workbook raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported') xlrd.biffh.XLRDError: Excel xlsx file; not supported
2. 确认Pandas版本高于1.0.1. 查看Pandas版本方法: >>> import pandas as pd >>> pd.show_versions() >>> pd.__version__
3. 安装并导入openpyxl,并且加上engine='openpyxl'(类似下图2)