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

Traceback (most recent call last):
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 3197, in execute_sql
cursor.execute(sql, params or ())
sqlite3.IntegrityError: NOT NULL constraint failed: dbbardata.turnover

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\vnpy\vnpy2.14\vnpy\app\data_manager\ui\widget.py", line 586, in download
count = self.engine.download_bar_data(symbol, exchange, interval, start)
File "C:\vnpy\vnpy2.14\vnpy\app\data_manager\engine.py", line 218, in download_bar_data
database_manager.save_bar_data(data)
File "C:\vnpy\vnpy2.14\vnpy\trader\database\database_sql.py", line 386, in save_bar_data
self.class_bar.save_all(ds)
File "C:\vnpy\vnpy2.14\vnpy\trader\database\database_sql.py", line 156, in save_all
c).on_conflict_replace().execute()
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 1927, in inner
return method(self, database, args, **kwargs)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 1998, in execute
return self._execute(database)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 2798, in _execute
return super(Insert, self)._execute(database)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 2511, in _execute
cursor = database.execute(self)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 3210, in execute
return self.execute_sql(sql, params, commit=commit)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 3204, in execute_sql
self.commit()
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 2970, in exit
reraise(new_type, new_type(exc_value,
exc_args), traceback)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 191, in reraise
raise value.with_traceback(tb)
File "C:\Users\hxjsj.DESKTOP-EDEL962\AppData\Roaming\Python\Python37\site-packages\peewee.py", line 3197, in execute_sql
cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: dbbardata.turnover

Member
avatar
加入于:
帖子: 3357
声望: 225

可以删除用户名目录下的.vntrader目录下的database.db再运行试试,删除前可以做好数据库的备份。

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

首先,谢谢!
先备份database.db后删除了,vnpy重启后再次运行时,报错提示问题与原来一样。

Member
avatar
加入于:
帖子: 3357
声望: 225

你用的数据库是sqlite吗?
turnover是2.5.0才加上的,如果你数据库里有2.5.0版本后建的表没删掉,然后用2.5.0之前的版本启动,就会报错
建议可以直接使用最新版本

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

description

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

以上是安装install.bat最新版本3.2.0后,执行python run.py后的结果。
同时,日志中仅有连接成功一条信息显示。

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

重新安装后:

description

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

以上是点击“功能”---“K线图表”-“新建图表”后的出错信息。

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

手动安装不顺利,就执行了https://download.vnpy.com/veighna_studio-3.2.0.exe自动安装,现在再次运行C:\vnpy3.2.0>python run.py,发现竟然可以”新建图表“了:

description

description

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

历史数据下载也已经正常了。

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

沪公网安备 31011502017034号

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