-2

通过运行jupyter-console任何Enter按钮显示此错误:

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...

我尝试过使用不同 Linux 发行版(Ubuntu、Mint、Manjaro KDE、Manjaro XFCE)的不同计算机。我尝试了不同的 python 版本(>3.6)、不同的 ipython 版本,甚至使用 Docker。

有趣的是jupyter-qtconsolejupyter-notebook并且ipython工作正常。

我搜索的所有答案都是关于ipythonjupyter-notebook,但我需要jupyter-console

4

1 回答 1

1
pip install jupyter-client==6.1.12

答案在这里:https ://github.com/jupyter/jupyter_console/issues/241

于 2021-12-11T20:02:36.280 回答