yutiansut / QUANTAXIS

QUANTAXIS 支持任务调度 分布式部署的 股票/期货/期权 数据/回测/模拟/交易/可视化/多账户 纯本地量化解决方案
https://yutiansut.github.io/QUANTAXIS/
MIT License
8.22k stars 2.97k forks source link

Jupyter 连kernel报错 #1526

Open nuswgg opened 4 years ago

nuswgg commented 4 years ago

问题反馈

当您安装/使用QUANTAXIS的时候如果遇到任何问题, 您可以在这里提出,我们会在24小时内给您答复

您使用的QUANTAXIS版本号是什么?


1.9.16

您的系统信息(包括系统版本,系统架构(32/64),内存大小等等)


Win 10 64 位, 内存16G,CPU 9代 i9

您的系统环境是什么?

- monodb: 4
- nodejs(V9以下版本)  :14
- python3.5/3.6: 3.6
- docker(有无): 无

您需要反馈的问题

无法使用jupyter notebook

Traceback (most recent call last):
  File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
    app.start()
  File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start
    self.asyncio_loop.run_forever()
  File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running

感谢您的反馈 如有意见和建议,请在此说明:

您的联系方式(QQ/EMAIL)

95528736

THANKS by yutiansut 2017.12

nuswgg commented 4 years ago

@天神,全部的报错如下

Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in app.launch_new_instance() File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start ioloop.IOLoop.instance().start() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running [I 14:11:22.607 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in app.launch_new_instance() File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start ioloop.IOLoop.instance().start() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running [I 14:11:25.612 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports ERROR:tornado.general:Uncaught exception in ZMQStream callback Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 438, in _run_callback callback(*args, *kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 300, in null_wrapper return fn(args, **kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell self.pre_handler_hook() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook self.saved_sigint_handler = signal(SIGINT, default_int_handler) File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ValueError: signal only works in main threadTraceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)

File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in app.launch_new_instance() File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start ioloop.IOLoop.instance().start() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running ERROR:tornado.general:Uncaught exception in zmqstream callback Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 456, in _handle_events self._handle_recv() File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 486, in _handle_recv self._run_callback(callback, msg) File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 438, in _run_callback callback(*args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 300, in null_wrapper return fn(*args, *kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell self.pre_handler_hook() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook self.saved_sigint_handler = signal(SIGINT, default_int_handler) File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ValueError: signal only works in main thread ERROR:tornado.application:Exception in callback functools.partial(<function wrap..null_wrapper at 0x000001D67FD549D8>) Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\ioloop.py", line 758, in _run_callback ret = callback() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 300, in null_wrapper return fn(args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 542, in self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0)) File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 456, in _handle_events self._handle_recv() File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 486, in _handle_recv self._run_callback(callback, msg) File "d:\ProgramData\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 438, in _run_callback callback(*args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\stack_context.py", line 300, in null_wrapper return fn(*args, *kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell self.pre_handler_hook() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 248, in pre_handler_hook self.saved_sigint_handler = signal(SIGINT, default_int_handler) File "d:\ProgramData\Anaconda3\lib\signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ValueError: signal only works in main thread [I 14:11:28.620 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports [W 14:11:29.687 NotebookApp] Timeout waiting for kernel_info reply from 264396cb-5fa4-4306-975b-1447422f7c51 [E 14:11:29.688 NotebookApp] Uncaught exception GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\websocket.py", line 546, in _run_callback result = callback(args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open super(ZMQChannelsHandler, self).open() File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: init() got an unexpected keyword argument 'io_loop' Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in app.launch_new_instance() File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start ioloop.IOLoop.instance().start() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running [E 14:11:30.722 NotebookApp] Uncaught exception GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\websocket.py", line 546, in _run_callback result = callback(*args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open super(ZMQChannelsHandler, self).open() File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: init() got an unexpected keyword argument 'io_loop' [I 14:11:31.636 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports [E 14:11:31.753 NotebookApp] Uncaught exception GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\websocket.py", line 546, in _run_callback result = callback(*args, *kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open super(ZMQChannelsHandler, self).open() File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: init() got an unexpected keyword argument 'io_loop' [E 14:11:32.786 NotebookApp] Uncaught exception GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\websocket.py", line 546, in _run_callback result = callback(args, kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open super(ZMQChannelsHandler, self).open() File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: init() got an unexpected keyword argument 'io_loop' Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 16, in app.launch_new_instance() File "d:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "d:\ProgramData\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 477, in start ioloop.IOLoop.instance().start() File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "d:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 408, in run_forever raise RuntimeError('This event loop is already running') RuntimeError: This event loop is already running [E 14:11:33.821 NotebookApp] Uncaught exception GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\tornado\websocket.py", line 546, in _run_callback result = callback(*args, **kwargs) File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open super(ZMQChannelsHandler, self).open() File "d:\ProgramData\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: init() got an unexpected keyword argument 'io_loop' [W 14:11:34.645 NotebookApp] KernelRestarter: restart failed [W 14:11:34.645 NotebookApp] Kernel 264396cb-5fa4-4306-975b-1447422f7c51 died, removing from map. [W 14:11:34.843 NotebookApp] 404 GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1): Kernel does not exist: 264396cb-5fa4-4306-975b-1447422f7c51 [W 14:11:34.849 NotebookApp] 404 GET /api/kernels/264396cb-5fa4-4306-975b-1447422f7c51/channels?session_id=0C30450B9E344BB584FEF23DCE75862D (::1) 7.98ms referer=None [W 14:11:36.861 NotebookApp] Replacing stale connection: 264396cb-5fa4-4306-975b-1447422f7c51:0C30450B9E344BB584FEF23DCE75862D

yutiansut commented 4 years ago

嗯 jupyter和tornado的开发者吵起来了.... 真服

nuswgg commented 4 years ago

问题终于解决 @yutiansut solution: pip install "pyzmq==17.0.0" "ipykernel==4.8.2"