pythonjupyterjupyter-console

jupyter-console raises an unnamed exception no matter what I type in


After opening jupyter-console in cmd, no matter what I input, I get the following unnamed exception. Any tips on what could be going wrong?

Unhandled exception in event loop:
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\input\win32.py", line 612, in ready
    callback()
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\application\application.py", line 707, in read_from_input
    self.key_processor.process_keys()
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\key_binding\key_processor.py", line 270, in process_keys
    self._process_coroutine.send(key_press)
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\key_binding\key_processor.py", line 185, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\key_binding\key_processor.py", line 320, in _call_handler
    handler.call(event)
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\prompt_toolkit\key_binding\key_bindings.py", line 124, in call
    result = self.handler(event)
             ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_console\ptshell.py", line 477, in _
    self.handle_iopub()
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_console\ptshell.py", line 854, in handle_iopub
    while run_sync(self.client.iopub_channel.msg_ready)():
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Seba\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_core\utils\__init__.py", line 149, in run_sync
    assert inspect.iscoroutinefunction(coro)

Exception
Press ENTER to continue...

Solution

  • See if the jupyter-client installed version is >= 8.0.0, in this case try downgrading to version 7.4.9:

    python -m pip install jupyter-client==7.4.9 --upgrade
    

    Don't know what's going on, but this solved the issue for me.

    Note: I'm using MacOS Ventura 13.1 and python 3.9.6, but also checked on MacOS Catalina 10.15.7 and python 3.10 and downgrading jupyter-client solved the issue.