【问题标题】:pywinauto TypeError: item 2 in _argtypes_ passes a union by value, which is unsupportedpywinauto TypeError:_argtypes_ 中的第 2 项通过值传递联合,这是不受支持的
【发布时间】:2020-11-10 10:03:06
【问题描述】:

我正在使用 pywinauto。

Python 3.7.6 pywinauto 0.6.8

导入 pywinauto 模块没有问题,但有以下问题:

代码:

from pywinauto.application import Application
app = Application(backend="uia").start("thinkorswim.exe")

结果:

Traceback (most recent call last):
  File "C:\Users\willi\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 121, in WINFUNCTYPE
    return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'ctypes.c_long'>, <class 'comtypes.automation.tagVARIANT'>, <class 'comtypes.LP_POINTER(IUIAutomationCondition)'>), 0)

During handling of the above exception, another exception occurred:

    prototype = WINFUNCTYPE(restype, *argtypes)
  File "C:\Users\willi\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 123, in WINFUNCTYPE
    class WinFunctionType(_CFuncPtr):
TypeError: item 2 in _argtypes_ passes a union by value, which is unsupported.

有朋友可以帮忙吗?

【问题讨论】:

    标签: python python-3.x pyautogui pywinauto


    【解决方案1】:

    这是在更高版本(3.7.7+ 或 3.8.2+)中修复的已知 Python 错误。在这里查看我的答案:Getting error while running a script which uses pywinauto

    请注意,您可能需要clean安装较新的 Python。

    【讨论】:

      猜你喜欢
      • 2020-05-10
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-20
      • 1970-01-01
      相关资源
      最近更新 更多