qq_31302607 2022-11-25 10:31 采纳率: 100%
浏览 70
已结题

Python自动化交易

问题遇到的现象和发生背景

刚学python,我是从github下载jqktrader项目,然后导入到pycharm中,自己写了个test.py,
但是运行报错啦。能不能帮忙看下,毫无头绪。

用代码块功能插入代码,请勿粘贴截图
import jqktrader

print('test')

运行结果及报错内容

D:\software\Anaconda\python.exe D:/workspace/pycharm_workspace/jqktrader-main/test/test.py
Traceback (most recent call last):
File "D:\software\Anaconda\lib\ctypes_init_.py", line 121, in WINFUNCTYPE
return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'comtypes.POINTER(IUIAutomationElement)'>, <class 'ctypes.c_long'>, <class 'comtypes.automation.tagVARIANT'>), 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:/workspace/pycharm_workspace/jqktrader-main/test/test.py", line 3, in
import jqktrader
File "D:\workspace\pycharm_workspace\jqktrader-main\jqktrader_init.py", line 5, in
from jqktrader.api import use
File "D:\workspace\pycharm_workspace\jqktrader-main\jqktrader\api.py", line 5, in
from .clienttrader import ClientTrader
File "D:\workspace\pycharm_workspace\jqktrader-main\jqktrader\clienttrader.py", line 14, in
from pywinauto import findwindows, timings
File "D:\software\Anaconda\lib\site-packages\pywinauto_init
.py", line 89, in
from . import findwindows
File "D:\software\Anaconda\lib\site-packages\pywinauto\findwindows.py", line 42, in
from . import controls
File "D:\software\Anaconda\lib\site-packages\pywinauto\controls_init_.py", line 36, in
from . import uiawrapper # register "uia" back-end (at the end of uiawrapper module)
File "D:\software\Anaconda\lib\site-packages\pywinauto\controls\uiawrapper.py", line 47, in
from ..uia_defines import IUIA
File "D:\software\Anaconda\lib\site-packages\pywinauto\uia_defines.py", line 181, in
pattern_ids = _build_pattern_ids_dic()
File "D:\software\Anaconda\lib\site-packages\pywinauto\uia_defines.py", line 169, in _build_pattern_ids_dic
if hasattr(IUIA().ui_automation_client, cls_name):
File "D:\software\Anaconda\lib\site-packages\pywinauto\uia_defines.py", line 50, in call
cls._instances[cls] = super(_Singleton, cls).call(*args, **kwargs)
File "D:\software\Anaconda\lib\site-packages\pywinauto\uia_defines.py", line 60, in init
self.UIA_dll = comtypes.client.GetModule('UIAutomationCore.dll')
File "D:\software\Anaconda\lib\site-packages\comtypes\client_generate.py", line 110, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "D:\software\Anaconda\lib\site-packages\comtypes\client_generate.py", line 184, in _CreateWrapper
mod = _my_import(fullname)
File "D:\software\Anaconda\lib\site-packages\comtypes\client_generate.py", line 24, in my_import
return import(fullname, globals(), locals(), ['DUMMY'])
File "D:\software\Anaconda\lib\site-packages\comtypes\gen_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py", line 853, in
( ['in'], VARIANT, 'newValue' )),
File "D:\software\Anaconda\lib\site-packages\comtypes_init
.py", line 329, in setattr
self.make_methods(value)
File "D:\software\Anaconda\lib\site-packages\comtypes_init
.py", line 698, in make_methods
prototype = WINFUNCTYPE(restype, *argtypes)
File "D:\software\Anaconda\lib\ctypes_init
.py", line 123, in WINFUNCTYPE
class WinFunctionType(_CFuncPtr):
TypeError: item 3 in argtypes passes a union by value, which is unsupported.

Process finished with exit code 1

我的解答思路和尝试过的方法

Python版本:3.8.3

我想要达到的结果

麻烦帮忙瞅瞅,感谢

  • 写回答

1条回答 默认 最新

  • 量化投资助手 2022-11-25 21:58
    关注

    你好,可能是python环境的问题,装32位的Anaconda试试,有朋友反馈过类似问题,可以详细看下文章中@2201_75327533的评论。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 12月15日
  • 已采纳回答 12月7日
  • 创建了问题 11月25日

悬赏问题

  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的