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

打开就报错,而且配置是在能打开vntrader之后才能改。仿佛陷入了一个死循环
也找不到配置文件在哪里,后台想改也不行。

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\peewee.py", line 2993, in connect
self._state.set_connection(self._connect())
File "c:\vnstudio\lib\site-packages\peewee.py", line 3891, in _connect
conn = mysql.connect(db=self.database, self.connect_params)
File "c:\vnstudio\lib\site-packages\pymysql__init__.py", line 94, in Connect
return Connection(*args,
kwargs)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 325, in init
self.connect()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 599, in connect
self._request_authentication()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 861, in _request_authentication
auth_packet = self._read_packet()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 684, in _read_packet
packet.check_error()
File "c:\vnstudio\lib\site-packages\pymysql\protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "c:\vnstudio\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnstation\cli.py", line 90, in run_trader
module = importlib.import_module(d["module"])
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\vnpy\app\cta_strategy\
init.py", line 9, in <module>
from .engine import CtaEngine
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 39, in <module>
from vnpy.trader.database import database_manager
File "c:\vnstudio\lib\site-packages\vnpy\trader\database\
init.py", line 12, in <module>
database_manager: "BaseDatabaseManager" = init(settings=settings)
File "c:\vnstudio\lib\site-packages\vnpy\trader\database\initialize.py", line 10, in init
return init_sql(driver=driver, settings=settings)
File "c:\vnstudio\lib\site-packages\vnpy\trader\database\initialize.py", line 17, in init_sql
_database_manager = init(driver, settings)
File "c:\vnstudio\lib\site-packages\vnpy\trader\database\database_sql.py", line 33, in init
bar, tick = init_models(db, driver)
File "c:\vnstudio\lib\site-packages\vnpy\trader\database\database_sql.py", line 322, in init_models
db.connect()
File "c:\vnstudio\lib\site-packages\peewee.py", line 2996, in connect
self._initialize_connection(self._state.conn)
File "c:\vnstudio\lib\site-packages\peewee.py", line 2831, in
exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "c:\vnstudio\lib\site-packages\peewee.py", line 183, in reraise
raise value.with_traceback(tb)
File "c:\vnstudio\lib\site-packages\peewee.py", line 2993, in connect
self._state.set_connection(self._connect())
File "c:\vnstudio\lib\site-packages\peewee.py", line 3891, in _connect
conn = mysql.connect(db=self.database, **self.connect_params)
File "c:\vnstudio\lib\site-packages\pymysql\
init.py", line 94, in Connect
return Connection(*args, **kwargs)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 325, in
init__
self.connect()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 599, in connect
self._request_authentication()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 861, in _request_authentication
auth_packet = self._read_packet()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 684, in _read_packet
packet.check_error()
File "c:\vnstudio\lib\site-packages\pymysql\protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "c:\vnstudio\lib\site-packages\pymysql\err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
peewee.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

Member
avatar
加入于:
帖子: 3587
声望: 234

配置文件在.vntrader文件夹下的vt_setting.json中

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

谢谢,我改了配置了,但是又出现了新的error

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnstation\cli.py", line 95, in run_trader
main_window = TraderMainWindow(main_engine, event_engine)
File "c:\vnstudio\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 48, in init
self.init_ui()
File "c:\vnstudio\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 55, in init_ui
self.init_menu()
File "c:\vnstudio\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 113, in init_menu
ui_module = import_module(app.app_module + ".ui")
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\vnpy_ctabacktester\ui\
init.py", line 1, in <module>
from .widget import BacktesterManager
File "c:\vnstudio\lib\site-packages\vnpy_ctabacktester\ui\widget.py", line 16, in <module>
from vnpy.trader.database import DB_TZ
ImportError: cannot import name 'DB_TZ' from 'vnpy.trader.database' (c:\vnstudio\lib\site-packages\vnpy\trader\database\
init__.py)

Member
avatar
加入于:
帖子: 3587
声望: 234

如果文件夹下面有这个文件,那么就是环境配置问题了

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

xiaohe wrote:

如果文件夹下面有这个文件,那么就是环境配置问题了

比如哪些配置要改呢?
我就是按照步骤来,只改了db的设置,而且我在db里面已经看到了两个自动生成的空的table
dbbardata,dbtickdata
但是打开的时候还是有这个报错

ImportError: cannot import name 'DB_TZ' from 'vnpy.trader.database' (c:\vnstudio\lib\site-packages\vnpy\trader\database__init__.py)

而且我看了 vnpy\trader\database 下面没有 DB_TZ 这个 script 来 import

description

Member
avatar
加入于:
帖子: 3587
声望: 234

请问你的VN Trader版本是?

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

沪公网安备 31011502017034号

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