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

是因为安装的xlrd版本异常导致。

原因:xlrd更新到了2.0.1版本,只支持.xls文件,不支持.xlsx。
解决方法:降级安装xlrd

D:\Python\Python37\Scripts>pip uninstall xlrd
Uninstalling xlrd-2.0.1:
  Would remove:
    d:\python\python37\lib\site-packages\xlrd-2.0.1.dist-info\*
    d:\python\python37\lib\site-packages\xlrd\*
    d:\python\python37\scripts\runxlrd.py
Proceed (y/n)? y
  Successfully uninstalled xlrd-2.0.1

D:\Python\Python37\Scripts>pip install xlrd==1.2.0
Collecting xlrd==1.2.0
  Downloading https://files.pythonhosted.org/packages/b0/16/63576a1a001752e34bf8ea62e367997530dc553b689356b9879339cf45a4/xlrd-1.2.0-py2.py3-none-any.whl (103kB)
     |████████████████████████████████| 112kB 467kB/s
Installing collected packages: xlrd
Successfully installed xlrd-1.2.0
WARNING: You are using pip version 19.2.3, however version 21.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

D:\Python\Python37\Scripts>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值