vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 20
声望: 3

各位大神好,今天尝试在UI界面的配置选项下,希望将sqlite 变更成mysql,可能是因为名字的大小写有问题,当我退出再次进入的时候已经不能运行run.py文件报错如下:
ValueError: 'MySQL' is not a valid Driver

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 33, in <module>
from vnpy.app.cta_strategy import CtaStrategyApp
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/app/cta_strategy/init.py", line 9, in <module>
from .engine import CtaEngine
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/app/cta_strategy/engine.py", line 39, in <module>
from vnpy.trader.database import database_manager
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/trader/database/init.py", line 12, in <module>
database_manager: "BaseDatabaseManager" = init(settings=settings)
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/trader/database/initialize.py", line 6, in init
driver = Driver(settings["driver"])
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 310, in call
return cls.new(cls, value)
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 564, in new
raise exc
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 548, in new
result = cls.missing(value)
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 577, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))
ValueError: 'MySQL' is not a valid Driver

我尝试寻找对应vnpy包的配置文件,发现setting文件所使用的数据库还是sqlite并没有更改,所以就不知道到底在哪错的了,也尝试重装vnpy和miniconda都没有得到解决,
谢谢解答

Member
avatar
加入于:
帖子: 20
声望: 3

我只是改了UI界面的配置的数据库的名字 没改对也不至于连界面都打不开吧,想改回去的机会都没得

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

看看/home/soda/.vntrader目录下面的配置文件

Member
avatar
加入于:
帖子: 20
声望: 3

guo9310 wrote:

看看/home/soda/.vntrader目录下面的配置文件

谢谢解答

Administrator
avatar
加入于:
帖子: 4122
声望: 229

soda wrote:

各位大神好,今天尝试在UI界面的配置选项下,希望将sqlite 变更成mysql,可能是因为名字的大小写有问题,当我退出再次进入的时候已经不能运行run.py文件报错如下:
ValueError: 'MySQL' is not a valid Driver

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 33, in <module>
from vnpy.app.cta_strategy import CtaStrategyApp
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/app/cta_strategy/init.py", line 9, in <module>
from .engine import CtaEngine
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/app/cta_strategy/engine.py", line 39, in <module>
from vnpy.trader.database import database_manager
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/trader/database/init.py", line 12, in <module>
database_manager: "BaseDatabaseManager" = init(settings=settings)
File "/home/soda/miniconda3/lib/python3.7/site-packages/vnpy/trader/database/initialize.py", line 6, in init
driver = Driver(settings["driver"])
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 310, in call
return cls.new(cls, value)
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 564, in new
raise exc
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 548, in new
result = cls.missing(value)
File "/home/soda/miniconda3/lib/python3.7/enum.py", line 577, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))
ValueError: 'MySQL' is not a valid Driver

我尝试寻找对应vnpy包的配置文件,发现setting文件所使用的数据库还是sqlite并没有更改,所以就不知道到底在哪错的了,也尝试重装vnpy和miniconda都没有得到解决,
谢谢解答

配置对话框中,数据库请写为mysql,全部小写

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

C:\Users\admin\.vntrader\vt_setting

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