comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

AttributeError: 'module' object has no attribute 'CUIAutomation'

Open haohetao opened this issue 3 years ago • 1 comments
trafficstars

Traceback (most recent call last): File "test.py", line 3, in from pywinauto.application import Application File "C:\Python27\lib\site-packages\pywinauto_init_.py", line 89, in from . import findwindows File "C:\Python27\lib\site-packages\pywinauto\findwindows.py", line 42, in from . import controls File "C:\Python27\lib\site-packages\pywinauto\controls_init_.py", line 36, in from . import uiawrapper # register "uia" back-end (at the end of uiawrapper module) File "C:\Python27\lib\site-packages\pywinauto\controls\uiawrapper.py", line 47 , in from ..uia_defines import IUIA File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 181, in pattern_ids = _build_pattern_ids_dic() File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 169, in _b uild_pattern_ids_dic if hasattr(IUIA().ui_automation_client, cls_name): File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 50, in c all cls._instances[cls] = super(_Singleton, cls).call(*args, **kwargs) File "C:\Python27\lib\site-packages\pywinauto\uia_defines.py", line 63, in i nit self.ui_automation_client.CUIAutomation().IPersist_GetClassID(), AttributeError: 'module' object has no attribute 'CUIAutomation'

comtypes 1.1.11 python 2.7.18 windows xp sp3

haohetao avatar Mar 07 '22 02:03 haohetao

Try to clean up comtypes cache by the script in C:\Python27\Scripts\

vasily-v-ryabov avatar Mar 07 '22 07:03 vasily-v-ryabov

This issue has been without updates for a long time, and support for Python 2.7 has been dropped. The situation can be resolved by running py -m comtypes.clear_cache. See also #517 and #114.

I will close this issue.

junkmd avatar Feb 28 '24 23:02 junkmd