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

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

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

解决方法:
找出目录pythonLibsite-packagesxlrd下的xlsx.py文件

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

原文地址:https://www.cnblogs.com/wbyixx/p/15241730.html