stainlessai / micronaut-jupyter

A Micronaut configuration that integrates your app with an existing Jupyter installation.
https://stainlessai.github.io/micronaut-jupyter
Apache License 2.0
9 stars 5 forks source link

MJ-37 ⁃ Polygot magics don't work #37

Open JoshuaCWebDeveloper opened 4 years ago

JoshuaCWebDeveloper commented 4 years ago

The following cells:

%%python
from beakerx.object import beakerx
beakerx.foo
%%scala
beakerx.foo

Will result in the error:

py4j.Py4JException: Error while obtaining a new communication channel

JavaScript works, but the beakerx object is not defined:

%%javascript
beakerx.foo
Javascript Error: beakerx is not defined

┆Reporter: Joshua Carter ┆Issue Type: Story ┆Priority: Lowest ┆Status: Backlog ┆Issue Number: MJ-37 ┆Epic: Kernel

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

This is happening because the magic kernel functionality expects the beakerx pyhton module to be installed. Error that causes the above cell errors:

java.io.IOException: Cannot run program "beakerx": error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at com.twosigma.beakerx.kernel.MagicKernelManager.initPythonProcess(MagicKernelManager.java:69) at com.twosigma.beakerx.kernel.MagicKernelManager.getPythonEntryPoint(MagicKernelManager.java:110) at com.twosigma.beakerx.kernel.Kernel.getPythonEntryPoint(Kernel.java:353) at com.twosigma.beakerx.kernel.magic.command.functionality.kernelMagic.KernelMagicCommand.execute(KernelMagicCommand.java:56) at com.twosigma.beakerx.kernel.magic.command.MagicCommand.execute(MagicCommand.java:47) at com.twosigma.beakerx.kernel.magic.command.MagicCommand.execute(MagicCommand.java:88) at com.twosigma.beakerx.kernel.magic.command.MagicCommand.executeLastFrame(MagicCommand.java:69) at com.twosigma.beakerx.kernel.Code.execute(Code.java:90) at com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler.handleMsg(ExecuteRequestHandler.java:63) at com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler.handle(ExecuteRequestHandler.java:51) at com.twosigma.beakerx.kernel.handler.ExecuteRequestHandler.handle(ExecuteRequestHandler.java:39) at ai.stainless.micronaut.jupyter.kernel.ClosableKernelSocketsZMQ.handleShell(ClosableKernelSocketsZMQ.java:203) at ai.stainless.micronaut.jupyter.kernel.ClosableKernelSocketsZMQ.run(ClosableKernelSocketsZMQ.java:178) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

The Javascript Error: beakerx is not defined error is also happening because the beakerx pyhton module is not installed (the python module adds the beakerx and beakerx_tabledisplay Jupyter widgets.

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

Installing beakerx on my machine fixes the errors with running the JVM magics. But the beakerx object in Javascript isn't working in any of the environments that I have beakerx installed in, so some of this functionality in beakerx is flaky to say the least. For now, the best option is to make a note in the README saying that beakerx functionality requires that beakerx be installed (and possibly other jupyter dependencies).

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

I've added a note to the README.md. I'm not sure whether anything else should be done or provided by this configuration or whether the configuration should just depend on the system being properly configured.

Going to deprioritize this issue for the time being until something further is decided.