pywinauto / py_inspect

Inspect.exe analoque for Windows with (Py3.5, pywinauto and PyQt) - this is officially supported fork
187 stars 73 forks source link

UIAutomationCore.dll is absent #6

Open VladislavPershin opened 3 years ago

VladislavPershin commented 3 years ago

Hi!

I try run py_inspect from Windows 10 and python 3.9. Here is pip's packets version:

image

When i run py_inspect i got this traceback:


C:\Users\User\git\py_inspect>python py_inspect.py
Traceback (most recent call last):
  File "C:\Users\User\git\py_inspect\py_inspect.py", line 21, in <module>
    from pywinauto import backend
  File "C:\Python39\lib\site-packages\pywinauto\__init__.py", line 89, in <module>
    from . import findwindows
  File "C:\Python39\lib\site-packages\pywinauto\findwindows.py", line 42, in <module>
    from . import controls
  File "C:\Python39\lib\site-packages\pywinauto\controls\__init__.py", line 36, in <module>
    from . import uiawrapper # register "uia" back-end (at the end of uiawrapper module)
  File "C:\Python39\lib\site-packages\pywinauto\controls\uiawrapper.py", line 47, in <module>
    from ..uia_defines import IUIA
  File "C:\Python39\lib\site-packages\pywinauto\uia_defines.py", line 181, in <module>
    pattern_ids = _build_pattern_ids_dic()
  File "C:\Python39\lib\site-packages\pywinauto\uia_defines.py", line 169, in _build_pattern_ids_dic
    if hasattr(IUIA().ui_automation_client, cls_name):
  File "C:\Python39\lib\site-packages\pywinauto\uia_defines.py", line 50, in __call__
    cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
  File "C:\Python39\lib\site-packages\pywinauto\uia_defines.py", line 60, in __init__
    self.UIA_dll = comtypes.client.GetModule('UIAutomationCore.dll')
  File "C:\Python39\lib\site-packages\comtypes\client\_generate.py", line 118, in GetModule
    mod = _CreateWrapper(tlib, pathname)
  File "C:\Python39\lib\site-packages\comtypes\client\_generate.py", line 183, in _CreateWrapper
    generate_module(tlib, ofi, pathname)
  File "C:\Python39\lib\site-packages\comtypes\tools\tlbparser.py", line 750, in generate_module
    gen.generate_code(list(items.values()), filename=pathname)
  File "C:\Python39\lib\site-packages\comtypes\tools\codegenerator.py", line 261, in generate_code
    tlib_mtime = os.stat(self.filename).st_mtime
FileNotFoundError: [WinError 2] Не удается найти указанный файл: 'UIAutomationCore.dll'

What i need to do for successfully run the py_inspect?

vasily-v-ryabov commented 3 years ago

Hi, you need to upgrade to comtypes==1.1.9 (just released). The fix is there.

wuyukk commented 3 years ago

https://stackoverflow.com/questions/65459632/cannot-import-pywinauto-on-windows-10

pip install -U comtypes pip install six pip install Pillow cd c:\windows\syswow64\ regsvr32 UIAutomationCore.dll