Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIAutomationCore.dll is absent #6

Open
VladislavPershin opened this issue Mar 12, 2021 · 2 comments
Open

UIAutomationCore.dll is absent #6

VladislavPershin opened this issue Mar 12, 2021 · 2 comments

Comments

@VladislavPershin
Copy link

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
Copy link

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

@wuyukk
Copy link

wuyukk commented Aug 23, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants