處xlsl格式的excel文件時,報錯:
File "D:\Python37\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
問題原因:
安裝的 xlrd-2.0.1,該版本只支持.xls文件
使用 pd.read_excel("2015Cities-CHINA.xlsx") 報錯
解決方法:
卸載當前安裝的xlrd
pip uninstall xlrd
安裝低版本的xlrd
pip install xlrd==1.2.0