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

安装过程很正常,但是要启动CtaStretegy 和 CtaBacktester 模块时会触发异常,出现以下报错,其他模块正常,卸掉重装还是一样,不知道什么原因。

系统环境是Win11,曾安装过anaconda,后来卸掉了,有没有可能是python版本冲突造成的?

2022-08-23 10:26:52 Traceback (most recent call last):
File "C:\veighna_studio\lib\site-packages\vnpy\trader\datafeed.py", line 50, in get_datafeed
module: ModuleType = import_module(module_name)
File "C:\veighna_studio\lib\importlib__init__.py", line 126, in import_module
2022-08-23 10:26:52 return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_loadunlocked
ModuleNotFoundError: No module named 'vnpy
'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\veighna_studio\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\veighna_studio\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "build\bdist.win-amd64\egg\veighna_station\trader.py", line 39, in <module>
File "build\bdist.win-amd64\egg\veighna_station\trader.py", line 30, in run_trader
File "C:\veighna_studio\lib\site-packages\vnpy\trader\engine.py", line 101, in add_app
engine: BaseEngine = self.add_engine(app.engine_class)
File "C:\veighna_studio\lib\site-packages\vnpy\trader\engine.py", line 72, in add_engine
engine: BaseEngine = engine_class(self, self.event_engine)
File "C:\veighna_studio\lib\site-packages\vnpy_ctastrategy\engine.py", line 111, in init
2022-08-23 10:26:52 self.datafeed: BaseDatafeed = get_datafeed()
File "C:\veighna_studio\lib\site-packages\vnpy\trader\datafeed.py", line 52, in get_datafeed
2022-08-23 10:26:52 print(f"\u627e\u4e0d\u5230\u6570\u636e\u670d\u52a1\u9a71\u52a8{module_name}\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684RQData\u6570\u636e\u670d\u52a1")
File "C:\veighna_studio\lib\encodings\cp1252.py", line 19, in encode
2022-08-23 10:26:52 return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-8: character maps to <undefined>

description

Member
avatar
加入于:
帖子: 1658
声望: 121

请检查下C:\users\administrator.vntrader\vt_setting.json这个配置文件,如果有异常就删掉后重启试下

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

MTF wrote:

请检查下C:\users\administrator.vntrader\vt_setting.json这个配置文件,如果有异常就删掉后重启试下

配置文件打开是空的,这样是正常的吗?

description

移除文件重启还是会跳出一样的报错

description

Member
avatar
加入于:
帖子: 716
声望: 63

中文编码有问题,可以参考一下https://jingyan.baidu.com/article/54b6b9c0a0c4d72d583b470b.html

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

郭易燔 wrote:

中文编码有问题,可以参考一下https://jingyan.baidu.com/article/54b6b9c0a0c4d72d583b470b.html

解决了,是编码的问题,修改后可以正常启动,谢谢。

另外想问下,启动后显示 “找不到数据服务驱动vnpy_,使用默认的RQData数据服务” ,要如何修改让这个信息消失?

description

Member
avatar
加入于:
帖子: 716
声望: 63

启动后在菜单栏中的全局配置中修改datafeed,改为rqdata或者自己使用的其他数据源名称,重启即可

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

沪公网安备 31011502017034号

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