“Pandas读取XLSX文件错误”的版本间的差异

来自YTYZX有图有真相的百科
跳转至: 导航搜索
(创建页面,内容为“ 1. 使用Pandas读取XLSX文件出现错误。 报错信息:File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\xlrd\__init__.py"...”)
(没有差异)

2022年4月16日 (六) 17:07的版本

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)