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

手动安装版本 2.7.0 在win10。

上两天配置好能跑 examples\vn_trader\run.py 出现图形界面后就心满意足的睡觉了。但今天跑报了标题的错。log如下。

神奇的是,trader\engine.py里面import这个SETTING没报错,但trader\database.py里面import就报错了。不知道是什么原因?

C:\Users\1\anaconda3\envs\vnpy-master-270\python.exe E:/Projects/vnpy-master-270/examples/vn_trader/run.py
Traceback (most recent call last):
File "E:/Projects/vnpy-master-270/examples/vn_trader/run.py", line 4, in <module>
from vnpy.trader.engine import MainEngine
File "E:\Projects\vnpy-master-270\vnpy\trader\engine.py", line 45, in <module>
from .setting import SETTINGS

File "E:\Projects\vnpy-master-270\vnpy\trader\setting.py", line 9, in <module>
from .utility import load_json
File "E:\Projects\vnpy-master-270\vnpy\trader\utility.py", line 954, in <module>
import vnpy_leveldb
File "C:\Users\1\anaconda3\envs\vnpy-master-270\lib\site-packages\vnpy_leveldb__init__.py", line 26, in <module>
from .leveldb_database import LeveldbDatabase as Database
File "C:\Users\1\anaconda3\envs\vnpy-master-270\lib\site-packages\vnpy_leveldb\leveldb_database.py", line 10, in <module>
from vnpy.trader.database import BaseDatabase, BarOverview, DB_TZ
File "E:\Projects\vnpy-master-270\vnpy\trader\database.py", line 10, in <module>
from .setting import SETTINGS

ImportError: cannot import name 'SETTINGS' from 'vnpy.trader.setting' (E:\Projects\vnpy-master-270\vnpy\trader\setting.py)

Process finished with exit code 1

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

问题解决了,是自己手滑加了个代码,导致了循环import。

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

沪公网安备 31011502017034号

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