xonsh_kernel icon indicating copy to clipboard operation
xonsh_kernel copied to clipboard

Doesn't work with JupyterLab (statements don't return)

Open icarito opened this issue 6 years ago • 5 comments

When submitting a command, shell wits forever (with an asterisk) and never returns. Console displays:

[I 13:12:12.296 LabApp] Kernel started: e7b452df-0c35-4a98-b3be-b8b55abbefc9
[I 13:12:13.493 LabApp] Adapting to protocol v5.1 for kernel e7b452df-0c35-4a98-b3be-b8b55abbefc9
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 14820, in default
    run_compiled_code(code, self.ctx, None, 'single')
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 2322, in run_compiled_code
    func(code, glb, loc)
  File "<xonsh-code>", line 1, in <module>
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/ipykernel/displayhook.py", line 34, in __call__
    sys.stdout.flush()
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 14667, in flush
    self.std.flush()
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/tempfile.py", line 848, in flush
    self._file.flush()
ValueError: I/O operation on closed file.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/metakernel/_metakernel.py", line 357, in do_execute
    retval = self.do_execute_direct(code)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh_kernel/kernel.py", line 45, in do_execute_direct
    out, err, interrupted = self._do_execute_direct(code)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh_kernel/kernel.py", line 74, in _do_execute_direct
    shell.default(code)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 14829, in default
    print_exception()
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 4286, in print_exception
    sys.stderr.write('xonsh: For full traceback set: '
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/site-packages/xonsh/__amalgam__.py", line 14663, in write
    self.std.write(std_s)
  File "/home/icarito/Proyectos/Jappy2/.direnv/python-3.5.3/lib/python3.5/tempfile.py", line 905, in write
    rv = file.write(s)
ValueError: I/O operation on closed file.
``

icarito avatar Feb 07 '18 18:02 icarito

Hi @icarito, which version of xonsh are you using?

blink1073 avatar Feb 13 '18 17:02 blink1073

Hi, I have:

$ xonsh -V
xonsh/0.6.0

Thanks!

icarito avatar Feb 13 '18 19:02 icarito

It looks like this kernel doesn't work with newer versions of xonsh (5+). I don't have the bandwidth to update it at the moment.

blink1073 avatar Feb 13 '18 21:02 blink1073

Xonsh would be cool to use with Jupyter Lab.

alexdelorenzo avatar Jun 10 '20 04:06 alexdelorenzo

xonsh ships with a kernel. I haven't tried it in jlab though

scopatz avatar Jun 13 '20 02:06 scopatz