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

Errors when trying to use Python autotranslation in JVM kernels #8314

Open
jest opened this issue Oct 13, 2021 · 1 comment
Open

Errors when trying to use Python autotranslation in JVM kernels #8314

jest opened this issue Oct 13, 2021 · 1 comment

Comments

@jest
Copy link

jest commented Oct 13, 2021

When I try to execute any cell containing %%python in a JVM-based notebook, the following error is thrown and displayed as an output:

py4j.Py4JException: An exception was raised by the Python Proxy. Return Message: Traceback (most recent call last):
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/py4j/clientserver.py", line 581, in _call_proxy
    return_value = getattr(self.pool[obj_id], method)(*params)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/beakerx_kernel_autotranslation/jvm_server.py", line 27, in evaluate
    self.pm.run_cell(code)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/beakerx_kernel_autotranslation/jvm_kernel_magic.py", line 44, in run_cell
    self.kc.execute(code, allow_stdin=True)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/jupyter_client/blocking/client.py", line 20, in _
    msg_id = meth(self, *args, **kwargs)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/jupyter_client/client.py", line 607, in execute
    self.shell_channel.send(msg)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/jupyter_client/channels.py", line 263, in send
    self.session.send(self.socket, msg)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/jupyter_client/session.py", line 853, in send
    stream.send_multipart(to_send, copy=copy)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/zmq/_future.py", line 248, in send_multipart
    return self._add_send_event('send_multipart', msg=msg, kwargs=kwargs)
  File "/opt/conda/envs/beakerx/lib/python3.7/site-packages/zmq/_future.py", line 410, in _add_send_event
    f = future or self._Future()
  File "/opt/conda/envs/beakerx/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-5'.

The error happens on installation made either from cloned repos (i.e. like cd beakerx_kernel_groovy/groovy-dist; pip install -r requirements.txt --verbose; beakerx_kernel_groovy install) or from published packages (i.e. conda install -n beakerx -c beakerx beakerx_all).

I also have an old installation laying around made from Github cloned repos on 2020-11-06, where the error doesn't occur.

@jest
Copy link
Author

jest commented Oct 19, 2021

After trying numerous configurations, I limited the problem to a single package.

The problem occurs in conjunction with version 7 of jupyter_client. When instead forcing the installation of jupyter_client=6.1.12, or adding

  - jupyter_client<7

to dependencies in beakerx-dist/configuration.yml, the exception is not raised in the Java notebook with %%python magic.

Unfortunately, I lack the knowledge of Jupyter inner workings to trace the actual bug; The changelog of jupyter_client doesn't give me clue either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant