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

 

 

posted @ 2021-04-13 17:46  胸怀丶若谷  阅读(1233)  评论(0编辑  收藏  举报