ricequant / rqalpha

A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
http://rqalpha.io
Other
5.39k stars 1.62k forks source link

运行 rqalpha update_bundle 报错 #308

Closed Yuwenqing closed 6 years ago

Yuwenqing commented 6 years ago

1. RQAlpha的版本

3,0,9

2. Python的版本

64 3.5.2

3. 是Windows/Linux/MacOS or others?

Windows 10 64位

4. 您出现问题对应的源码/或者能复现问题的简易代码 以及对应的配置

5. 您出现的错误堆栈日志信息

尝试 http://7xjci3.com1.z0.glb.clouddn.com/bundles_v3/rqbundle_20180429.tar.bz2 ... Traceback (most recent call last): File "c:\anaconda3\lib\runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "c:\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)  │ └ {'cached': 'C:\Anaconda3\Scripts\rqalpha.exe\pycache\main.cpython-35.pyc', 'package': '', 'spec': Modul...  └ <code object at 0x000001E5E1654C90, file "C:\Anaconda3\Scripts\rqalpha.exe__main.py", line 2> File "C:\Anaconda3\Scripts\rqalpha.exe__main.py", line 9, in sys.exit(entry_point()) │ └ <function entry_point at 0x000001E5EC99FF28> └ <module 'sys' (built-in)> File "c:\anaconda3\lib\site-packages\rqalpha\main__.py", line 70, in entry_point cli(obj={}) └ <click.core.Group object at 0x000001E5EB925D68> File "c:\anaconda3\lib\site-packages\click\core.py", line 716, in call__ return self.main(args, kwargs)  │ │ └ {'obj': {'VERBOSE': 0}}  │ └ ()  └ <click.core.Group object at 0x000001E5EB925D68> File "c:\anaconda3\lib\site-packages\click\core.py", line 696, in main rv = self.invoke(ctx)  │ └ <click.core.Context object at 0x000001E5E0D97AC8>  └ <click.core.Group object at 0x000001E5EB925D68> File "c:\anaconda3\lib\site-packages\click\core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx))  │ │ └ <click.core.Context object at 0x000001E5EC9F16A0>  │ └ <click.core.Context object at 0x000001E5EC9F16A0>  └ <function MultiCommand.invoke.._process_result at 0x000001E5ECA11E18> File "c:\anaconda3\lib\site-packages\click\core.py", line 889, in invoke return ctx.invoke(self.callback, ctx.params)  │ │ └ <click.core.Context object at 0x000001E5EC9F16A0>  │ └ <click.core.Command object at 0x000001E5EC9A21D0>  └ <click.core.Context object at 0x000001E5EC9F16A0> File "c:\anaconda3\lib\site-packages\click\core.py", line 534, in invoke return callback(args, **kwargs)  │ │ └ {'locale': 'zh_Hans_CN', 'data_bundle_path': 'C:\Users\Yuwenqing/.rqalpha'}  │ └ ()  └ <function update_bundle at 0x000001E5EC9A4378> File "c:\anaconda3\lib\site-packages\rqalpha__main__.py", line 81, in update_bundle main.update_bundle(data_bundle_path, locale) │ │ └ 'zh_Hans_CN' │ └ 'C:\Users\Yuwenqing/.rqalpha' └ <module 'rqalpha.main' from 'c:\anaconda3\lib\site-packages\rqalpha\main.py'> File "c:\anaconda3\lib\site-packages\rqalpha\main.py", line 153, in update_bundle r = requests.get(url, stream=True)  │ └ 'http://7xjci3.com1.z0.glb.clouddn.com/bundles_v3/rqbundle_20180429.tar.bz2'  └ <module 'requests' (namespace)> AttributeError: module 'requests' has no attribute 'get'

Cuizi7 commented 6 years ago

麻烦查看下您的 requests 库版本 pip list 并尝试更新 requests 库 pip install -U requests

wooego commented 6 years ago
  1. RQAlpha的版本 3,0,9

  2. Python的版本 64 3.5.4

  3. 是Windows/Linux/MacOS or others? Linux debian9 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux 本地的locale设置: LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=

  4. 您出现问题对应的源码/或者能复现问题的简易代码 以及对应的配置 运行 rqalpha update_bundle时出错

  5. 您出现的错误堆栈日志信息

Traceback (most recent call last): File "/home/fp862/anaconda3/envs/fpricequant/bin/rqalpha", line 11, in sys.exit(entry_point()) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/rqalpha/main.py", line 70, in entry_point cli(obj={}) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/click/core.py", line 722, in call return self.main(args, kwargs) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(args, **kwargs) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/rqalpha/main.py", line 81, in update_bundle main.update_bundle(data_bundle_path, locale) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/rqalpha/main.py", line 132, in update_bundle set_locale(locale) File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/site-packages/rqalpha/utils/config.py", line 122, in set_locale locale.setlocale(locale.LC_ALL, "en_US.UTF-8") File "/home/fp862/anaconda3/envs/fpricequant/lib/python3.5/locale.py", line 594, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

想来是locale设置问题,必须设置为en_US.UTF-8么? 与#215号问题类似,找到答案了。