asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

pyautogui 0.9.53 & comtypes 1.1.11: AttributeError: module 'comtypes.gen.UIAutomationClient' has no attribute 'CUIAutomation' #675

Open ScottGriffin213 opened 2 years ago

ScottGriffin213 commented 2 years ago

Stacktrace

[snip]
  File "F:\Projects\VRChat\vrctool-packages\devtools\packagetool.py", line 257, in _decompileToInner
    from pywinauto.application import Application
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\__init__.py", line 89, in <module>
    from . import findwindows
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\findwindows.py", line 42, in <module>
    from . import controls
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\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:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\controls\uiawrapper.py", line 47, in <module>
    from ..uia_defines import IUIA
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\uia_defines.py", line 181, in <module>
    pattern_ids = _build_pattern_ids_dic()
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\uia_defines.py", line 169, in _build_pattern_ids_dic
    if hasattr(IUIA().ui_automation_client, cls_name):
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\uia_defines.py", line 50, in __call__
    cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
  File "C:\Users\USERNAME\AppData\Local\pypoetry\Cache\virtualenvs\vrctool-packages-athMvMIA-py3.9\lib\site-packages\pywinauto\uia_defines.py", line 63, in __init__
    self.ui_automation_client.CUIAutomation().IPersist_GetClassID(),
AttributeError: module 'comtypes.gen.UIAutomationClient' has no attribute 'CUIAutomation'

Environment

$ poetry show
autopep8           1.6.0         A tool that automatically formats Python code to conform to the PEP 8 style guide
cached-property    1.5.2         A decorator for caching properties in classes.
certifi            2021.10.8     Python package for providing Mozilla's CA Bundle.
cffi               1.15.0        Foreign Function Interface for Python calling C code.
charset-normalizer 2.0.12        The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.
click              8.0.4         Composable command line interface toolkit
colorama           0.4.4         Cross-platform colored terminal text.
comtypes           1.1.11        Pure Python COM package
configparser       5.2.0         Updated configparser from Python 3.8 for Python 2.6+.
construct          2.10.68       A powerful declarative symmetric parser/builder for binary data
cryptography       36.0.1        cryptography is a package which provides cryptographic recipes and primitives to Python developers.
future             0.18.2        Clean single-source support for Python 3 and 2
idna               3.3           Internationalized Domain Names in Applications (IDNA)
isort              5.10.1        A Python utility / library to sort Python imports.
jinja2             3.0.3         A very fast and expressive template engine.
lxml               4.8.0         Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
markupsafe         2.1.0         Safely add untrusted strings to HTML/XML markup.
mouseinfo          0.1.3         An application to display XY position and RGB color information for the pixel currently under the mouse. Works on Python 2 and 3.
mypy               0.931         Optional static typing for Python
mypy-extensions    0.4.3         Experimental type system extensions for programs checked with the mypy typechecker.
packaging          21.3          Core utilities for Python packages
pbkdf2             1.3           PKCS#5 v2.0 PBKDF2 Module
pefile             2021.9.3      Python PE parsing module
pgpy               0.5.4         Pretty Good Privacy for Python
poetryup           0.5.4         Update dependencies and bump their version in the pyproject.toml file
psutil             5.9.0         Cross-platform lib for process and system monitoring in Python.
pyasn1             0.4.8         ASN.1 types and codecs
pyautogui          0.9.53        PyAutoGUI lets Python control the mouse and keyboard, and other GUI automation tasks. For Windows, macOS, and Linux, on Python 3 and 2.
pybuildtools       0.4.8         A set of tools for putting together buildscripts and other CLI applications
pycodestyle        2.8.0         Python style guide checker
pycparser          2.21          C parser in Python
pycsbinarywriter   0.0.1 aa03a63 Emulation of BinaryWriter serialization in C#.
pygetwindow        0.0.9         A simple, cross-platform module for obtaining GUI information on application's windows.
pygit2             1.9.0         Python bindings for libgit2.
pymsgbox           1.0.9         A simple, cross-platform, pure Python module for JavaScript-like message boxes.
pyparsing          3.0.7         Python parsing module
pyperclip          1.8.2         A cross-platform clipboard module for Python. (Only handles plain text for now.)
pyrect             0.1.4         PyRect is a simple module with a Rect class for Pygame-like rectangular areas.
pyscreeze          0.1.28        A simple, cross-platform screenshot module for Python 2 and 3.
python-dateutil    2.8.2         Extensions to the standard Python datetime module
python-magic       0.4.25        File type identification using libmagic
pytweening         1.0.4         A collection of tweening / easing functions.
pytz               2021.3        World timezone definitions, modern and historical
pywin32            303           Python for Window Extensions
pywinauto          0.6.8         A set of Python modules to automate the Microsoft Windows GUI
pyyaml             6.0           YAML parser and emitter for Python
requests           2.27.1        Python HTTP for Humans.
ruamel.yaml        0.17.21       ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
ruamel.yaml.clib   0.2.6         C version of reader, parser and emitter for ruamel.yaml derived from libyaml
semantic-version   2.9.0         A library implementing the 'SemVer' scheme.
six                1.16.0        Python 2 and 3 compatibility utilities
toml               0.10.2        Python Library for Tom's Obvious, Minimal Language
toml-sort          0.19.0        Toml sorting library
tomli              2.0.1         A lil' TOML parser
tomlkit            0.8.0         Style preserving TOML library
tqdm               4.63.0        Fast, Extensible Progress Meter
typer              0.4.0         Typer, build great CLIs. Easy to code. Based on Python type hints.
typing-extensions  4.1.1         Backported and Experimental Type Hints for Python 3.6+
urllib3            1.26.8        HTTP library with thread-safe connection pooling, file post, and more.
vrctool            0.0.1 ae382fc VRChat Swiss Army Knife - Common tools for VRChat in a simple CLI package.
vsgen              0.3.3         A Microsoft Visual Studio solution and project generator pyackage.