AttributeError:module‘win32com.gen_py has no attribute ‘CLSIDToClassMap‘

解决方案如下:

1. 运行如下代码,找到文件所在位置

from win32com.client.gencache import EnsureDispatch
import sys
xl = EnsureDispatch("Word.Application")
print(sys.modules[xl.__module__].__file__)

运行结果如下图所示:

 2.进入改目录下,删除所有格式中带有“00000000”的文件夹,如下图所示:

至此问题解决。

参考链接:https://www.geekschool.org/2020/08/06/15167.html

 

不考虑业务场景,一味的争执技术的高下,都是耍流氓。
原文地址:https://www.cnblogs.com/leoych/p/14654456.html