Open BoPeng opened 4 years ago
similar issues are found with ipython on Debian 10, python 3.7 , xonsh_kernel installed via pipenv
pipenv install xonsh_kernel pipenv shell python -m xonsh_kernel.install ipython console --kernel calysto_xonsh
In [1]: echo "ddd"
:
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
yield gen.maybe_future(handler(stream, idents, msg))
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 541, in execute_request
user_expressions, allow_stdin,
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/metakernel/_metakernel.py", line 395, in do_execute
retval = self.do_execute_direct(code)
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/xonsh_kernel/kernel.py", line 45, in do_execute_direct
out, err, interrupted = self._do_execute_direct(code)
File "/home//.local/share/virtualenvs/-bk1jwvoh/lib/python3.7/site-packages/xonsh_kernel/kernel.py", line 60, in _do_execute_direct
shell = builtins.xonsh_shell
AttributeError: module 'builtins' has no attribute 'xonsh_shell'
__xonsh_shell__
was renamed to __xonsh__.shell
many versions ago. That should be the only update (and similar renames) that is needed. The deprecation warnings and proxies were removed in v0.9.9: https://xon.sh/changelog#v0-9-9
$ pip list | grep xon
xonsh 0.9.13.dev1
xonsh-kernel 0.4.1
So the problem should be with xonsh-kernel
, which has not been updated with the newer versions of xonsh
.
Hello BoPeng, thanks for following that up
I have manged to get the Calysto/xonsh_kernel to work with Jupyter lab
I updated python3.7/site-packages/xonsh_kernel/kernel.py on my machine by replacing all occurrences of
and jupyter lab now works with the Calysto/xonsh_kernel t
I left these statements as is swap(builtins, 'xonsh_stdout_uncaptured', out), \ swap(builtins, 'xonsh_stderr_uncaptured', err), \
but they might need changing to swap(builtins, 'xonsh.stdout_uncaptured', out), \
here is my modified kernel.py file
kernel.TXT swap(builtins, 'xonsh.stderr_uncaptured', err), \
regards
@WardThomas Could you please create a PR? @blink1073 would be happy to take a look and merge it, even add you as a maintainer of the project.
Seconded :smile:
MacOSX, python 3.7, xonsh-0.9.13.dev1, xonsh-kernel-0.4.1, starting jupyter notebook, enter
ls
, notebook hangs with the following error message displayed in console