Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyter-client 7.0+ support #118

Closed
rpigott opened this issue Nov 25, 2021 · 2 comments
Closed

jupyter-client 7.0+ support #118

rpigott opened this issue Nov 25, 2021 · 2 comments
Labels
jupyter bug This issue reflects an underlying Jupyter bug

Comments

@rpigott
Copy link

rpigott commented Nov 25, 2021

Backwards incompatible changes in jupyter-client 7.0+ have broken the jupyter console with this kernel.

The following traceback is printed when attempting to execute any statement:

Unhandled exception in event loop:
  File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.9/site-packages/prompt_toolkit/input/vt100.py", line 170, in callback_wrapper
    callback()
  File "/usr/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 690, in read_from_input
    self.key_processor.process_keys()
  File "/usr/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_processor.py", line 271, in process_keys
    self._process_coroutine.send(key_press)
  File "/usr/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 "/usr/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_processor.py", line 321, in _call_handler
    handler.call(event)
  File "/usr/lib/python3.9/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call
    result = self.handler(event)
  File "/usr/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 475, in _
    self.handle_iopub()
  File "/usr/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 854, in handle_iopub
    msg_type = sub_msg['header']['msg_type']

jupyter client has a migration guide published which may help: https://jupyter-client.readthedocs.io/en/latest/migration.html.

The changes don't look too substantial, but I'm not too familiar with the jupyter architecture and wasn't able to correct the issue.

@cc-wr cc-wr added the bug Something isn't working label Nov 26, 2021
@cc-wr cc-wr pinned this issue Nov 26, 2021
@cc-wr
Copy link
Contributor

cc-wr commented Dec 1, 2021

This seems like a general issue with jupyter-console when it is used with jupyter-client 7.0+. I got the same issue when I tried the IPython kernel on the console with jupyter-client 7.0+.

There are some other GitHub issues for this at jupyter/jupyter_client#690 and jupyter/jupyter_console#251. Thankfully, it seems like the jupyter-console people have merged in a fix for this bug at jupyter/jupyter_console#244. I tried the changes myself, and they seemed to work:

$ jupyter --version | grep jupyter_client
jupyter_client   : 7.1.0
$ jupyter console --kernel=wolframlanguage13
Jupyter console 6.4.0 # with the changes from #244 manually added in

Wolfram Language/Wolfram Engine Copyright 2019

Note: This Jupyter kernel was installed through the WolframScript install method. Accordingly, updates to a WolframLanguageForJupyter paclet will not affect this kernel.
In [1]: 2+2
Out[1]: 4

I think we just have to wait for a released version of jupyter-console with these changes. For now, a temporary solution would be to just downgrade the version of jupyter-client of course.

@cc-wr cc-wr added jupyter bug This issue reflects an underlying Jupyter bug and removed bug Something isn't working labels Dec 1, 2021
@rpigott
Copy link
Author

rpigott commented Dec 2, 2021

Oh, interesting. Thanks for the links and your help.

@rpigott rpigott closed this as completed Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jupyter bug This issue reflects an underlying Jupyter bug
Projects
None yet
Development

No branches or pull requests

2 participants