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

报错如下:
runfile('D:/Software/vnstudio/Lib/site-packages/load_csv.py', wdir='D:/Software/vnstudio/Lib/site-packages')
Traceback (most recent call last):

File "<ipython-input-3-b10d314c99d6>", line 1, in <module>
runfile('D:/Software/vnstudio/Lib/site-packages/load_csv.py', wdir='D:/Software/vnstudio/Lib/site-packages')

File "D:\Software\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)

File "D:\Software\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/Software/vnstudio/Lib/site-packages/load_csv.py", line 26, in <module>
datetime_format = "%Y-%m-%d %H:%M:%S")

File "D:\Software\vnstudio\Lib\site-packages\vnpy\app\csv_loader\engine.py", line 142, in load
datetime_format=datetime_format,

File "D:\Software\vnstudio\Lib\site-packages\vnpy\app\csv_loader\engine.py", line 108, in load_by_handle
database_manager.save_bar_data(bars)

File "D:\Software\vnstudio\Lib\site-packages\vnpy\trader\database\database_sql.py", line 374, in save_bar_data
self.class_bar.save_all(ds)

File "D:\Software\vnstudio\Lib\site-packages\vnpy\trader\database\database_sql.py", line 149, in save_all
c).on_conflict_replace().execute()

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 1785, in inner
return method(self, database, *args, **kwargs)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 1856, in execute
return self._execute(database)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2572, in _execute
return super(Insert, self)._execute(database)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2320, in _execute
cursor = database.execute(self)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2962, in execute
return self.execute_sql(sql, params, commit=commit)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2956, in execute_sql
self.commit()

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2732, in exit
reraise(new_type, new_type(*exc_args), traceback)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 183, in reraise
raise value.with_traceback(tb)

File "D:\Software\vnstudio\Lib\site-packages\peewee.py", line 2949, in execute_sql
cursor.execute(sql, params or ())

OperationalError: table dbbardata has no column named open_interest

我要导入的csv文件里有open_interest这一列了,请问这个报错的原因是什么?

Member
加入于:
帖子: 8
声望: 0

我也是getdata中下rq的历史数据出现这个问题。借楼求教

Administrator
avatar
加入于:
帖子: 4545
声望: 324

https://www.vnpy.com/forum/topic/722-vn-pyfa-bu-v2-0-4-suan-fa-jiao-yi

使用这里的升级脚本来升级数据库

Member
加入于:
帖子: 8
声望: 0

用Python的交易员 wrote:

https://www.vnpy.com/forum/topic/722-vn-pyfa-bu-v2-0-4-suan-fa-jiao-yi

使用这里的升级脚本来升级数据库
图片不知道怎么插不进去。就用文字了

File "<ipython-input-3-9f884b3206d8>", line 1, in <module>
runfile('F:/vnpy/vnpy-2.0.4/tests/backtesting/getdata.py', wdir='F:/vnpy/vnpy-2.0.4/tests/backtesting')

File "F:\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "F:\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "F:/vnpy/vnpy-2.0.4/tests/backtesting/getdata.py", line 65, in <module>
download_minute_bar("IF88.CFFEX")

File "F:/vnpy/vnpy-2.0.4/tests/backtesting/getdata.py", line 53, in download_minute_bar
database_manager.save_bar_data(bars)

File "F:\Anaconda3\lib\site-packages\vnpy\trader\database\database_sql.py", line 374, in save_bar_data
self.class_bar.save_all(ds)

File "F:\Anaconda3\lib\site-packages\vnpy\trader\database\database_sql.py", line 147, in save_all
c).on_conflict_replace().execute()

File "F:\Anaconda3\lib\site-packages\peewee.py", line 1785, in inner
return method(self, database, *args, **kwargs)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 1856, in execute
return self._execute(database)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2571, in _execute
return super(Insert, self)._execute(database)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2320, in _execute
cursor = database.execute(self)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2953, in execute
return self.execute_sql(sql, params, commit=commit)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2947, in execute_sql
self.commit()

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2729, in exit
reraise(new_type, new_type(*exc_args), traceback)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 183, in reraise
raise value.with_traceback(tb)

File "F:\Anaconda3\lib\site-packages\peewee.py", line 2940, in execute_sql
cursor.execute(sql, params or ())

IntegrityError: NOT NULL constraint failed: dbbardata.vt_symbol

Member
加入于:
帖子: 8
声望: 0

用Python的交易员 wrote:

https://www.vnpy.com/forum/topic/722-vn-pyfa-bu-v2-0-4-suan-fa-jiao-yi

使用这里的升级脚本来升级数据库

升级完之后在save_all时候仍然有上一层所述报错。。。很奇怪。

Administrator
avatar
加入于:
帖子: 4545
声望: 324

那可能你数据库版本太老了,请直接删除c:\users\administrator.vntrader\database.db,然后重启吧

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

沪公网安备 31011502017034号

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