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

配置mysql之后,每次重启机器运行VNSTUDIO都会出现以下exception,在启动mysql workbench后点击一下local instance mysql 80后连接一下数据库就好了,代码里有自动连接登录吗?

Exception has occurred: RuntimeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
'cryptography' package is required for sha256_password or caching_sha2_password auth methods
File "C:\vnstudio\Lib\site-packages\pymysql_auth.py", line 144, in sha2_rsa_encrypt
"'cryptography' package is required for sha256_password or caching_sha2_password auth methods"
File "C:\vnstudio\Lib\site-packages\pymysql_auth.py", line 265, in caching_sha2_password_auth
data = sha2_rsa_encrypt(conn.password, conn.salt, conn.server_public_key)
File "C:\vnstudio\Lib\site-packages\pymysql\connections.py", line 932, in _request_authentication
auth_packet = _auth.caching_sha2_password_auth(self, auth_packet)
File "C:\vnstudio\Lib\site-packages\pymysql\connections.py", line 633, in connect
self._request_authentication()
File "C:\vnstudio\Lib\site-packages\pymysql\connections.py", line 353, in init
self.connect()
File "C:\vnstudio\Lib\site-packages\peewee.py", line 4013, in _connect
conn = mysql.connect(db=self.database, **self.connect_params)
File "C:\vnstudio\Lib\site-packages\peewee.py", line 3096, in connect
self._state.set_connection(self._connect())
File "C:\vnstudio\Lib\site-packages\vnpy_mysql\mysql_database.py", line 137, in init
self.db.connect()
File "C:\vnstudio\Lib\site-packages\vnpy\trader\database.py", line 137, in get_database
database = module.Database()
File "C:\vnstudio\Lib\site-packages\vnpy_ctastrategy\engine.py", line 107, in init
self.database: BaseDatabase = get_database()
File "C:\vnstudio\Lib\site-packages\vnpy\trader\engine.py", line 74, in add_engine
engine = engine_class(self, self.event_engine)
File "C:\vnstudio\Lib\site-packages\vnpy\trader\engine.py", line 99, in add_app
engine = self.add_engine(app.engine_class)
File "C:\vnstudio\run.py", line 84, in main
main_engine.add_app(CtaStrategyApp)
File "C:\vnstudio\run.py", line 112, in <module>
main()
File "C:\vnstudio\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\vnstudio\Lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\vnstudio\Lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\vnstudio\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\vnstudio\Lib\runpy.py", line 193, in _run_module_as_main (Current frame)
"main", mod_spec)

Super Moderator
avatar
加入于:
帖子: 658
声望: 50

vnpy在运行后会去连接配置的数据库,但无法启动数据库。如果是需要在机器重启后自动运行mysql,可以通过添加到开机自启系统服务等方法,自行在机器上设置。

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

沪公网安备 31011502017034号

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