python 3.9调 用 xlrd 1.2.0 报错 AttributeError: 'ElementTree' object has no attribute 'getiterator'

FLowUs邀请链接:https://flowus.cn/login?code=AXNU63
FlowUs邀请码:AXNU63


参照:https://blog.csdn.net/suhao0911/article/details/110950742

在新版python3.9中,windows中使用的更新删除了getiterator方法,所以我们老版本的xlrd库调用getiterator方法时会报错。AttributeError: 'ElementTree' object has no attribute 'getiterator'

解决方法:
找出目录python\Lib\site-packages\xlrd下的xlsx.py文件

修改两个地方的的getiterator()改成iter(),下面的两个地方,这里已经把getiterator()改成iter()了
image
image
然后重新载入程序即可

posted @ 2021-09-08 10:49  wbytts  阅读(2139)  评论(0编辑  收藏  举报