Python的兼容性是遇到就有点头痛的问题。在win7下处理Excel,目前发现3个包需要降版本。
(1)Python在Win7下画excel图表,出现兼容性的问题:
如上图,报错:
raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')
xlrd.biffh.XLRDError: Excel xlsx file; not supported
解决方法:把xlrd包降版本到1.2.0
(2)把xlrd包降版本后,再次运行程序,又报第二个错:
如上图,报错
f"module {cls.__module__!r} has no attribute {name!r}")
AttributeError: module 'matplotlib' has no attribute 'verbose'
解决方法,把matplotlib降低至2.2.5版本。
(3)完成修改excel的程序功能时,又报了第三个错:
如上图,报错
self.impl = engines.active.apps.add(
AttributeError: 'NoneType' object has no attribute 'apps'
解决方法:将pywin32降低至228版本。
即可解决问题。