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

vnpy 依赖的环境搭建完毕,但在 powershell 中运行 “python run.py” 时出现如下异常报错:

PS D:\vnpy-3.9.1\examples\veighna_trader> python run.py
Traceback (most recent call last):
File "D:\vnpy-3.9.1\examples\veighna_trader\run.py", line 7, in <module>
from vnpy_ctp import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp__init.py", line 26, in <module>
from .gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\
init.py", line 1, in <module>
from .ctp_gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\ctp_gateway.py", line 31, in <module>
from ..api import (
File "D:\python\lib\site-packages\vnpy_ctp\api\
init.py", line 1, in <module>
from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy_ctp.api.vnctpmd'
PS D:\vnpy-3.9.1\examples\veighna_trader> pip install vnpy_ctp
Requirement already satisfied: vnpy_ctp in d:\python\lib\site-packages (6.7.2.0)
Requirement already satisfied: importlib-metadata in d:\python\lib\site-packages (from vnpy_ctp) (7.0.2)
Requirement already satisfied: zipp>=0.5 in d:\python\lib\site-packages (from importlib-metadata->vnpy_ctp) (3.18.1)
PS D:\vnpy-3.9.1\examples\veighna_trader> python run.py
Traceback (most recent call last):
File "D:\vnpy-3.9.1\examples\veighna_trader\run.py", line 7, in <module>
from vnpy_ctp import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\
init.py", line 26, in <module>
from .gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\
init.py", line 1, in <module>
from .ctp_gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\ctp_gateway.py", line 31, in <module>
from ..api import (
File "D:\python\lib\site-packages\vnpy_ctp\api\
init__.py", line 1, in <module>
from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy_ctp.api.vnctpmd'

依赖的库已经校验版本都是满足的,唯有talib=0.4.26(官方要求0.4.24但此处并无报错),目前的python==3.10.14, vnpy ==3.9.1,求助应该如何处理?谢谢

Member
加入于:
帖子: 11
声望: 0

ethanlaw wrote:

vnpy 依赖的环境搭建完毕,但在 powershell 中运行 “python run.py” 时出现如下异常报错:

PS D:\vnpy-3.9.1\examples\veighna_trader> python run.py
Traceback (most recent call last):
File "D:\vnpy-3.9.1\examples\veighna_trader\run.py", line 7, in <module>
from vnpy_ctp import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp__init.py", line 26, in <module>
from .gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\
init.py", line 1, in <module>
from .ctp_gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\ctp_gateway.py", line 31, in <module>
from ..api import (
File "D:\python\lib\site-packages\vnpy_ctp\api\
init.py", line 1, in <module>
from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy_ctp.api.vnctpmd'
PS D:\vnpy-3.9.1\examples\veighna_trader> pip install vnpy_ctp
Requirement already satisfied: vnpy_ctp in d:\python\lib\site-packages (6.7.2.0)
Requirement already satisfied: importlib-metadata in d:\python\lib\site-packages (from vnpy_ctp) (7.0.2)
Requirement already satisfied: zipp>=0.5 in d:\python\lib\site-packages (from importlib-metadata->vnpy_ctp) (3.18.1)
PS D:\vnpy-3.9.1\examples\veighna_trader> python run.py
Traceback (most recent call last):
File "D:\vnpy-3.9.1\examples\veighna_trader\run.py", line 7, in <module>
from vnpy_ctp import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\
init.py", line 26, in <module>
from .gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\
init.py", line 1, in <module>
from .ctp_gateway import CtpGateway
File "D:\python\lib\site-packages\vnpy_ctp\gateway\ctp_gateway.py", line 31, in <module>
from ..api import (
File "D:\python\lib\site-packages\vnpy_ctp\api\
init__.py", line 1, in <module>
from .vnctpmd import MdApi
ModuleNotFoundError: No module named 'vnpy_ctp.api.vnctpmd'

依赖的库已经校验版本都是满足的,唯有talib=0.4.26(官方要求0.4.24但此处并无报错),目前的python==3.10.14, vnpy ==3.9.1,求助应该如何处理?谢谢

已解决,检查了下是因为python版本不对应的问题,重新安装了对应的ctp的包就修复了。

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

已解决。用VS 编译CTP的包,把生成的pyd 文件拷贝到对应目录

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

沪公网安备 31011502017034号

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