更改

跳转至: 导航搜索

Pandas读取XLSX文件错误

添加590字节, 2022年4月16日 (六) 17:07
创建页面,内容为“ 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)

导航菜单