vn.py官网
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 9
声望: 0

回测数据完成但后面就报错了,感觉应该是图表显示出现问题,请教一下怎么解决?AttributeError: module 'six' has no attribute 'wraps'

Traceback (most recent call last):
File "C:\vnstudio\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\vnstudio\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\Administrator.vscode\extensions\ms-python.python-2021.1.502429796\pythonFiles\lib\python\debugpy__main.py", line 45, in <module>
cli.main()
File "c:\Users\Administrator.vscode\extensions\ms-python.python-2021.1.502429796\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
File "c:\Users\Administrator.vscode\extensions\ms-python.python-2021.1.502429796\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("
main"))
File "C:\vnstudio\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\vnstudio\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\vnstudio\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\vnstudio\Lib\site-packages\vnpy\app\ctastrategy\backtesting\backtesting_1单示例.py", line 25, in <module>
engine.show_chart()
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 586, in show_chart
fig.show()
File "C:\vnstudio\lib\site-packages\plotly\basedatatypes.py", line 3397, in show
return pio.show(self, *args, **kwargs)
File "C:\vnstudio\lib\site-packages_plotly_utils\importers.py", line 36, in
getattr
class_module = importlib.import_module(rel_module, parent_name)
File "C:\vnstudio\lib\importlib\
init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\vnstudio\lib\site-packages\plotly\io_renderers.py", line 12, in <module>
from plotly.io._base_renderers import (
File "C:\vnstudio\lib\site-packages\plotly\io_base_renderers.py", line 12, in <module>
from plotly.io._orca import ensure_server
File "C:\vnstudio\lib\site-packages\plotly\io_orca.py", line 1454, in <module>
@retrying.retry(wait_random_min=5, wait_random_max=10, stop_max_delay=60000)
File "C:\vnstudio\lib\site-packages\retrying.py", line 47, in wrap
@six.wraps(f)
AttributeError: module 'six' has no attribute 'wraps'

Member
avatar
加入于:
帖子: 2788
声望: 189

不知道backtesting_1单示例.py是什么文件了
官方版本cta_strategy文件夹下没有backtesting文件夹,只有backtesting.py

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

也就是说我的无图表回测文件放错地方了吗?

Member
avatar
加入于:
帖子: 2788
声望: 189

看上去像是你是用pycharm回测,然后poltly报错了。新手还是建议使用vscode吧,无界面回测建议使用jupyter_notebook

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

沪公网安备 31011502017034号