jupyter_console icon indicating copy to clipboard operation
jupyter_console copied to clipboard

jupyter console broken on latest conda-forge. Regression from jupyter_client-7.0.2

Open slonik-az opened this issue 4 years ago • 3 comments

At least on MacOS jupyter console 6.4.0 is broken on fresh install from conda-forge. Regression seems to be caused by jupyter_client 7.0.2. Downgrading jupyter_client from 7.0.2 to 6.1.12 seems to resolve the problem.

How to reproduce

  1. Fresh install from conda-forge $ conda create -c conda-forge -n exp python=3.9 jupyter
  2. Activate newly created environment $ conda activate exp
  3. Start jupyter console and then hit enter $ jupyter console <hit ENTER>

Output

Click to expand
Jupyter console 6.4.0

Python 3.9.7 | packaged by conda-forge | (default, Sep 14 2021, 01:18:03)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: /opt/mambaforge/envs/exp/lib/python3.9/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 "/opt/mambaforge/envs/exp/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/input/vt100.py", line 168, in callback_wrapper
    callback()
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 691, in read_from_input
    self.key_processor.process_keys()
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_processor.py", line 274, in process_keys
    self._process_coroutine.send(key_press)
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_processor.py", line 186, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_processor.py", line 329, in _call_handler
    handler.call(event)
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 102, in call
    result = self.handler(event)
  File "/opt/mambaforge/envs/exp/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 475, in _
    self.handle_iopub()
  File "/opt/mambaforge/envs/exp/lib/python3.9/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...

Workaround

Downgrading to jupyrer_client 6.1.12 seems to solve the problem $ conda install -c conda-forge jupyter_client=6.1.12 $ jupyter console Seems to be working OK now.

slonik-az avatar Sep 14 '21 12:09 slonik-az

Thanks to @davidbrochart for pointing to PR https://github.com/jupyter/jupyter_console/pull/244 that seems to address the root cause of the issue migrating from jupyter_client 6.x to 7.x.

slonik-az avatar Sep 14 '21 13:09 slonik-az

So this is fixed, right?

NeilGirdhar avatar Nov 23 '21 06:11 NeilGirdhar

Yes but not released yet.

davidbrochart avatar Nov 23 '21 07:11 davidbrochart