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

出现了这个问题请问如何解决
Traceback (most recent call last):
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3152, in connect
self._state.set_connection(self._connect())
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3885, in _connect
conn = psycopg2.connect(params)
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\psycopg2__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory,
kwasync)
psycopg2.OperationalError: invalid port number: "0"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\vnpy\vnpy-master (22)\vnpy-master\run.py", line 58, in <module>
main()
File "E:\vnpy\vnpy-master (22)\vnpy-master\run.py", line 33, in main
main_engine.add_app(CtaStrategyApp)
File "E:\vnpy\vnpy-master (22)\vnpy-master\vnpy\trader\engine.py", line 101, in add_app
engine: BaseEngine = self.add_engine(app.engine_class)
File "E:\vnpy\vnpy-master (22)\vnpy-master\vnpy\trader\engine.py", line 72, in add_engine
engine: BaseEngine = engine_class(self, self.event_engine)
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\vnpy_ctastrategy\engine.py", line 110, in init
self.database: BaseDatabase = get_database()
File "E:\vnpy\vnpy-master (22)\vnpy-master\vnpy\trader\database.py", line 158, in get_database
database = module.Database()
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\vnpy_postgresql\postgresql_database.py", line 154, in init
self.db.connect()
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3151, in connect
with exception_wrapper:
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 2989, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 191, in reraise
raise value.with_traceback(tb)
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3152, in connect
self._state.set_connection(self._connect())
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\peewee.py", line 3885, in _connect
conn = psycopg2.connect(params)
File "C:\Users\AISMART-WORK\AppData\Local\Programs\Python\Python310\lib\site-packages\psycopg2__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory,
kwasync)
peewee.OperationalError: invalid port number: "0"

Member
avatar
加入于:
帖子: 640
声望: 34

PostgreSQL的数据库端口配置为0了,修改为正确的端口即可

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

改了一下.vntrader里面的vt_setting.json,把数据库改为sqlite,就好了。

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

沪公网安备 31011502017034号

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