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环境是不是又影响?