xlrd.biffh.XLRDError: Excel xlsx file; not supported 。我也来蹭一下热度~
哎,之前装了pandas之后,试了一下,发现:
1.问题的出现
import pandas as pddata = pd.read_excel('123.xlsx')
哈哈,兴高采烈的run了一把,然鹅,意外发生了:
这都能错?无语了。
额额额额,报错了。
2.错误的分析
2.1 查看xlrd版本
C:\Users\Administrator>pip show xlrd
Name: xlrd
Version: 2.0.1
Summary: Library for developers to extract data from Microsoft Excel (tm) .xls spreadsheet files
Home-page: http://www.python-excel.org/
Author: Chris Withers
Author-email: chris@withers.org
License: BSD
Location: d:\python38-32\lib\site-packages
Requires:
Required-by:C:\Users\Administrator>
发现版本是2.0.1 ,请先记住这个版本 。
2.2 分析报错
........一大堆....................................File "D:\Python38-32\lib\site-packages\xlrd\__init__.py", line 170, in open_workbookraise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
进入__init__.py 的190行,发现源码为:
file_format = inspect_format(filename, file_contents)# We have to let unknown file formats pass through here, as some ancient# files that xlrd can parse don't start with the expected signature.if file_format and file_format != 'xls':raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
看到了没?
原因就在这里,不支持xlsx,那么自己动动小手改成xls吧~
3.我偏要用xlsx文件格式
3.1 可以安装旧版xlrd,在cmd中运行:
pip uninstall xlrd
pip install xlrd==1.2.0
3.2 用openpyxl代替xlrd打开.xlsx文件:
data = pd.read_excel(‘123.xlsx’, engine=‘openpyxl’)
此处openpyxl版本见:
4.结语
我是小白, 解决了这个问题之后,我笑了,捂着额头开心不起来了。
别投降,万一赢了呢-----来自王者荣耀箴言
xlrd.biffh.XLRDError: Excel xlsx file; not supported 。我也来蹭一下热度~相关推荐
- pd.read_excel出现xlrd.biffh.XLRDError: Excel xlsx file; not supported解决方案
大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.喜 ...
- 关于xlrd.biffh.XLRDError: Excel xlsx file; not supported报错问题的两种解决方案
关于xlrd.biffh.XLRDError: Excel xlsx file; not supported的解决方法 问题描述 在做机器学习实验时,需要将一月入库信息表.xlsx等文件读入作为数据集 ...
- python openpyxl 操作excel xlrd.biffh.XLRDError: Excel xlsx file; not supported错误修改
python xlrd/openpyxl 操作excel xlrd.biffh.XLRDError: Excel xlsx file; not supported错误修改 代码: 错误: excel读 ...
- Python使用xlrd读取Excel数据时,“xlrd.biffh.XLRDError: Excel xlsx file; not supported”报错的解决方法
最近,在使用PyCharm编辑器进行xlrd读取Excel数据时,出现了"xlrd.biffh.XLRDError: Excel xlsx file; not supported" ...
- python+selenium 安装 xlrd 报错解决xlrd.biffh.XLRDError: Excel xlsx file; not supported
xlrd.biffh.XLRDError: Excel xlsx file; not supported 原因xlrd 2.0版本后只能支持.xls格式文件 解决方式: 安装1.2.0版本的xlrd ...
- xlrd.biffh.XLRDError: Excel xlsx file; not supported解决方法
xlrd.biffh.XLRDError: Excel xlsx file: not supported解决方法 在运用python中xlrd库读取.xlsx文件时报错,无法读取.这是由于当前pyth ...
- xlrd.biffh.XLRDError: Excel xlsx file; not supported报错
xlrd.biffh.XLRDError: Excel xlsx file: not supported报错 **原因是最近xlrd更新到了2.0.1版本,只支持.xls文件.所以pandas.rea ...
- pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported
pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file: not supported 新版xlrd报 Excel xlsx file: not ...
- 读取xlsx文件错误:xlrd.biffh.XLRDError: Excel xlsx file; not supported
利用Python库xlrd中的xlrd.open_workbook()函数读取自定义xlsx表格文件时出错如下: Traceback (most recent call last):File &quo ...
最新文章
- 【转】DontDestroyOnLoad(Unity3D开发之五)
- java 字符串去掉换行_java第一个程序quot;helloworldquot;
- 改进你的代码-扩展了一下IEnumerableT
- table偏见和HTML仇外心理
- 荣耀Magic4核心配置曝光:最强驯龙高手 性能远超iPhone 13 Pro
- Matlab二进制文件的读写
- Java编程:按照指定的字段顺序,将 Bean 转换为 Json
- sedna进行xquery查询
- JZ29 最小的K个数 剑指Offer 40
- 数值计算(一):引论
- win7下安装vc6.0(sp5,sp6补丁安装)
- html5显示用户已读取文章,如何查看公众号文章是谁阅读
- 多目标进化算法详细讲解及代码实现(样例:MOEA/D、NSGA-Ⅱ求解多目标(柔性)作业车间调度问题)
- kali linux 入侵教程,kali linux 入侵wordpress! wpscan工具使用方法!
- C语言编程error c2236:unexpected ‘struck‘ _ _;原因
- python逻辑回归模型建模步骤_从原理到代码,轻松深入逻辑回归模型!
- turtle的setheading函数详解
- T2691 桶哥的问题——送桶
- mysql生成类似qq号_【mysql】类似QQ的好友关系表是怎么设计的?
- iOS 使用系统相册获取选取图片的名称
热门文章
- npoi 将html导出word,使用NPOI将数据导出为word格式里的table
- 不要小看 WebSocket!长连接、有状态、双向、全双工都是王炸技能
- LDGRB-01 3AFE61320954P0001
- WINCC 7.5 SP2 与 S7-1500的通讯不上的处理
- 我的世界服务器无线刷物品,《我的世界》1.12无限刷物品方法图文教学
- 《雪盈王》,一本漫画,一个游戏,一场梦……
- 使用unity粒子系统制作烟花
- 淘淘商城第78讲——查询商品详情添加缓存的分析
- java的“看门狗”锁续期可以用php redis这样实现【php锁续期、分布式锁、无锁请求队列超卖】解决【商家超卖(商品库存控制)、用户超买(秒杀订单控制)】问题。非demo 线上一直在用
- JS 刷新当前页面 返回上一页并刷新的方法