当前位置:网站首页>【bug】XLRDError: Excel xlsx file; not supported
【bug】XLRDError: Excel xlsx file; not supported
2022-07-29 06:00:00 【Machines don't learn I learn】
Today is children's Day , Record a bug.
A set of code written by the landlord is on the company's desktop , Today, we need to go to the grass-roots level , Just copy the project code to U disc , Then it appears when running code with notebooks at the grass-roots level :
raise ImportError(msg) from None
ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.
In fact, when this error occurs , I was surprised ... Because I have run similar code on notebooks before ( In the same environment ), Why not today .
According to the prompt , Installed xlrd
pip install xlrd
then , Then run the code and it appears :
raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
XLRDError: Excel xlsx file; not supported
The landlord said he was helpless ...
terms of settlement :
Wrong statement :
data = pd.read_excel('www.xlsx', sheet_name='C1')
Add at the back engine=‘openpyxl’, solve the problem
data = pd.read_excel('www.xlsx', sheet_name='C1',engine='openpyxl')
Grand summary :
as a result of pip The installation is up-to-date xlrd package , Only support .xls file . therefore pd.read_excel(‘xxx.xlsx’) Will report a mistake
resolvent 1: Install the old version xlrd
pip uninstall xlrd
pip install xlrd=1.2.0
Solution 2: Use openpyxl package
pd.read_excel(‘xxx.xlsx’, engine=‘openpyxl’)
A friendly reminder :
The code migration ( function ) when , Be sure to configure the same environment ,python edition , The version of the corresponding dependent Library .
Reference resources :
https://blog.csdn.net/m0_67457639/article/details/123746623
https://www.jianshu.com/p/ee893ecae0f5
边栏推荐
- 初探fastJson的AutoType
- 性能对比|FASS iSCSI vs NVMe/TCP
- Spring, summer, autumn and winter with Miss Zhang (3)
- My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future
- Training log II of the project "construction of Shandong University mobile Internet development technology teaching website"
- Get the number of daffodils
- 在uni-app项目中,如何实现微信小程序openid的获取
- Rsync+inotyfy realize real-time synchronization of single data monitoring
- Go|gin quickly use swagger
- Flutter 绘制技巧探索:一起画箭头(技巧拓展)
猜你喜欢
![[go] use of defer](/img/10/9e4e1c593870450c381a154f31ebef.png)
[go] use of defer

Research on the implementation principle of reentrantlock in concurrent programming learning notes

centos7 静默安装oracle

Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')

My ideal job, the absolute freedom of coder farmers is the most important - the pursuit of entrepreneurship in the future

Training log II of the project "construction of Shandong University mobile Internet development technology teaching website"

File permissions of day02 operation

ReportingService WebService Form身份验证

Markdown语法

并发编程学习笔记 之 Lock锁及其实现类ReentrantLock、ReentrantReadWriteLock和StampedLock的基本用法
随机推荐
D3.JS 纵向关系图(加箭头,连接线文字描述)
Fantom (FTM) prices will soar by 20% in the next few days
突破硬件瓶颈(一):Intel体系架构的发展与瓶颈挖掘
Thinkphp6 output QR code image format to solve the conflict with debug
【go】defer的使用
FFmpeg创作GIF表情包教程来了!赶紧说声多谢乌蝇哥?
Lock lock of concurrent programming learning notes and its implementation basic usage of reentrantlock, reentrantreadwritelock and stampedlock
Show profiles of MySQL is used.
[database] database course design - vaccination database
Changed crying, and finally solved cannot read properties of undefined (reading 'parsecomponent')
Research and implementation of flash loan DAPP
Tear the ORM framework by hand (generic + annotation + reflection)
ssm整合
NIFI 改UTC时间为CST时间
day02 作业之文件权限
Most PHP programmers don't understand how to deploy safe code
Android Studio 实现登录注册-源代码 (连接MySql数据库)
Idea using JDBC to connect mysql database personal detailed tutorial
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
与张小姐的春夏秋冬(1)