Python读取excel xlrd读取xlsx报错:Excel xlsx file; not supported

问题描述
Python
使用 xlrd
读取excel xlsx
文件的时候报错发生异常: XLRDError (note: full exception trace is shown but execution is paused at: <module>)
Excel xlsx file;
not supported
File "C:\Users\XQ-Garson\Desktop\Python\gz\run_positionbyxls.py", line 68, in <module> (Current frame) data = xlrd.open_workbook(fileName) # 打开xls文件

原因分析
python
插件 xlrd
在因为 1.2.0后面得版本 取消 了对 xlsx
文件得读取,那么我们把版本号换到以前得可以读取得版本就可以了!
对,就是这么简单!
解决方案
卸载 现在的 xlrd
重新安装 xlrd
指定版本位 1.2.0
PowerShell 全选
# 卸载 xlrd
pip uninstall xlrd
# 安装 1.2.0 版本的 xlrd
pip install xlrd==1.2.0
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
post 管理员