vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 4
声望: 0

print(sys.path)
['', 'C:\vnstudio\python37.zip', 'C:\vnstudio\DLLs', 'C:\vnstudio\lib', 'C:\vnstudio', 'C:\vnstudio\lib\site-packages', 'C:\vnstudio\lib\site-packages\win32', 'C:\vnstudio\lib\site-packages\win32\lib', 'C:\vnstudio\lib\site-packages\Pythonwin']
from typing import Any, Callable
from vnpy.app.cta_strategy import(
... CtaTemplate
... )

在cmd里面可以导入CtaTemplate 但是在jupyter里面会报错
ModuleNotFoundError Traceback (most recent call last)

<ipython-input-1-afea00479c1a> in <module>
1 #%%
----> 2 from vnpy.app.cta_strategy.backtesting import BacktestingEngine, OptimizationSetting
3 from vnpy.app.cta_strategy.strategies.atr_rsi_strategy import (
4 AtrRsiStrategy,
5 )

ModuleNotFoundError: No module named 'vnpy.app'

VSCODE里面也会报错
No name 'app' in module 'vnpy'pylint(no-name-in-module)

我换了台电脑按照视频课程上安装可以,这台电脑以前装过python环境是不是又影响?

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

解决了是因为anaconda里面的jupyter notebook 和 vnstation里面带的jupyter notebook 冲突了

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