VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 10
声望: 0

环境:ubuntu18.04 LTS

安装方法:bash install.sh

可以加载ctp连接simnow,但是我准备实盘,所以需要在期货公司那里进行穿透测试,所以这里加载ctptest

代码

#!/usr/bin/env python

from vnpy.gateway.ctptest import CtptestGateway

报错

Traceback (most recent call last):
  File "./test_run.py", line 4, in <module>
    from vnpy.gateway.ctptest import CtptestGateway
  File "/home/jlz/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest/__init__.py", line 1, in <module>
    from .ctptest_gateway import CtptestGateway
  File "/home/jlz/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest/ctptest_gateway.py", line 6, in <module>
    from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy.gateway.ctptest.vnctpmd'

但是这个文件夹下面确实有这个文件

(vnpy3.7.6) jlz@jlz-GE62-2QD:~/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest$ pwd
/home/jlz/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest
(vnpy3.7.6) jlz@jlz-GE62-2QD:~/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest$ ls
ctp_constant.py  ctptest_gateway.py  __init__.py  __pycache__  thostmduserapi_se.dll  thosttraderapi_se.dll  vnctpmd.pyd  vnctptd.pyd
(vnpy3.7.6) jlz@jlz-GE62-2QD:~/.pyenv/versions/vnpy3.7.6/lib/python3.7/site-packages/vnpy/gateway/ctptest$

请问是什么原因呢?

Administrator
avatar
加入于:
帖子: 4500
声望: 320

CTPTEST接口没有做Ubuntu下的自动编译,要用的话请自行编译了。另外穿透式测试建议用Windows,不要用Ubuntu

Member
avatar
加入于:
帖子: 10
声望: 0

用Python的交易员 wrote:

CTPTEST接口没有做Ubuntu下的自动编译,要用的话请自行编译了。另外穿透式测试建议用Windows,不要用Ubuntu

明白了,谢谢!

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】