python-3.xjupyter-notebookipythonjupyterjupyter-console

jupyter-console "RuntimeWarning: coroutine 'ZMQSocketChannel.msg_ready' was never awaited"


By running jupyter-console any press of Enter button show this error:

In [1]: /home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py:852: RuntimeWarning: coroutine 'ZMQSocketChannel.msg_ready' was never awaited
  while self.client.iopub_channel.msg_ready():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Unhandled exception in event loop:
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/input/vt100.py", line 168, in callback_wrapper
    callback()
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 691, in read_from_input
    self.key_processor.process_keys()
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 274, in process_keys
    self._process_coroutine.send(key_press)
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 186, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 329, in _call_handler
    handler.call(event)
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 102, in call
    result = self.handler(event)
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py", line 475, in _
    self.handle_iopub()
  File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py", line 854, in handle_iopub
    msg_type = sub_msg['header']['msg_type']

Exception 'coroutine' object is not subscriptable
Press ENTER to continue...

I have tried different computers with different Linux distributions (Ubuntu, Mint, Manjaro KDE, Manjaro XFCE). I tried different python versions (>3.6), different ipython verions and even with Docker.

Interesting that jupyter-qtconsole ,jupyter-notebook and ipython are working fine.

All answers I searched were about ipython or jupyter-notebook, but I need jupyter-console.


Solution

  • pip install jupyter-client==6.1.12
    

    The answer is here: https://github.com/jupyter/jupyter_console/issues/241