Original address: https://mlln.cn/2018/04/23/win32com-gen-py%E9%94%99%E8%AF%AFhas-no-attribute-CLSIDToClassMap/
Error code:
import win32com.client as win32
word = win32.gencache.EnsureDispatch('Word.Application') ## 报错位置
Error prompt:
AttributeError: module ‘win32com.gen_py.00020905-0000-0000-C000-000000000046x0x8x5’ has no attribute ‘CLSIDToClassMap’
Solution: Just delete C:\Users\Erica\AppData\Local\Temp\gen_py\3.7
the cache folder in the directory , 00020905-0000-0000-C000-000000000046x0x8x5
and re-execute the above code and no more errors will be reported.
Tip:
Use Everything search gen_py
to determine gen_py
the location of the folder .