python - pywinauto TypeError : item 2 in _argtypes_ passes a union by value, 不受支持

标签 python python-3.x pyautogui pywinauto

我正在使用 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.

有 friend 可以帮忙吗?

最佳答案

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

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

关于python - pywinauto TypeError : item 2 in _argtypes_ passes a union by value, 不受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63007486/

相关文章:

python - 如何用Python模拟键盘点击来控制游戏?

python - 动态设置scrapy请求回调

python - 为什么这两个约束导致我的 LP 模型在 Gurobi 中不可行?

python - 方法内的多处理回调不起作用

python - PyAutoGUIlocateOnScreen 方法中 minSearchTime 参数的目标是什么?

python - 如何触发 Windows 和 L 键 Python 热键?

python - 查找匹配 2 列条件的单个数据帧行索引

python - Tweepy Twitter 获取特定用户的所有推文回复

python - 如何获取字符串中某个子字符串之前和之前的所有内容?

javascript - Python 3.4,如何在网站上执行Javascript并捕获结果? (就像在浏览器中显示的那样)