xonsh / xontrib-jupyter

Xonsh jupyter kernel allows to run Xonsh shell code in Jupyter, JupyterLab, Euporia, etc.
MIT License
32 stars 4 forks source link

Error starting xonsh kernel: `xonsh.__amalgam__.XonshError: jupyter is not recognized as a shell type` #6

Closed cgranade closed 1 year ago

cgranade commented 2 years ago

To reproduce on a Windows 11 system running Anaconda from PowerShell:

PS> conda create -n xonsh pip notebook
PS> conda activate xonsh
PS> pip install xonsh
PS> xonsh
$ xpip install xontrib-jupyter-shell
$ exit
PS> xonsh
$ xontrib load jupyter
$ xonfig jupyter-kernel
$ exit
PS> jupyter notebook

In the Jupyter session opened up by the last command, creating a new Xonsh notebook results in the following errors being written to the console:

[I 08:09:36.455 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\site-packages\xonsh_jupyter\kernel.py", line 504, in <module>
    main()
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\site-packages\xonsh_jupyter\kernel.py", line 486, in main
    setup(
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\site-packages\xonsh\__amalgam__.py", line 22484, in setup
    XSH.shell = Shell(execer, ctx=ctx, shell_type=shell_type)
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\site-packages\xonsh\__amalgam__.py", line 15234, in __init__
    self.shell = self.construct_shell_cls(
  File "C:\Users\cgran\Anaconda3\envs\xonsh\lib\site-packages\xonsh\__amalgam__.py", line 15195, in construct_shell_cls
    raise XonshError(f"{backend} is not recognized as a shell type")
xonsh.__amalgam__.XonshError: jupyter is not recognized as a shell type

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment