Python xlrd.biffh.XLRDError: Excel xlsx file; not supported


處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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM