Open 7822f248-ba56-45f1-ab3d-4de7482bdf9f opened 4 years ago
Workaround: install Sage's Jupyter kernel in systemwide Jupyter installation.
$ JUPTER_KERNELS=/path/to/jupyter/kernels
$ SAGE_LOCAL=`$ sage -c "print(SAGE_LOCAL)"`
$ SAGE_KERNEL=$SAGE_LOCAL/share/jupyter/kernels/sagemath
$ ln -s $SAGE_KERNEL $JUPYTER_KERNELS
To find out what to use for /path/to/jupyter/kernels
:
$ jupyter kernelspec list
See also:
Replying to @slel:
Workaround: install Sage's Jupyter kernel in systemwide Jupyter installation.
$ JUPTER_KERNELS=/path/to/jupyter/kernels $ SAGE_LOCAL=`$ sage -c "print(SAGE_LOCAL)"` $ SAGE_KERNEL=$SAGE_LOCAL/share/jupyter/kernels/sagemath $ ln -s $SAGE_KERNEL $JUPYTER_KERNELS
Thanks ! This works.
To find out what to use for
/path/to/jupyter/kernels
:$ jupyter kernelspec list
A bashism to find this programatically is :
jupyter kernelspec list| grep python3 | sed -re "s/[ \t]+/ /g" | cut -d " " -f 3 | sed "s/\/python3//"
If this can be generalized to our other supported platforms, this might allow to dispense with Jupyter in sage-the-distribution, in line with the current effort to (be able to) use a maximum of systemwide tools.
See also:
- sage-devel: Installing sage as a kernel in the system-wide jupyter, tip posted by Nils Bruin
- Stack Overflow: Install SageMath kernel in Jupyter, especially answer by user "Layek"
Interesting.
Do you think that this ticket should be :
Thank you again !
Do you think that this ticket should be:
- Left open to work on using external kernels with Sage
- Closed as invalid (if we move to "external" jupyter)
- Be reworked to patch this "external" jupyter solution into Sage itself?
Document symlinking Jupyter kernels both ways between systemwide Jupyter and Sage's one.
Did you try symlinking the other way, i.e. find the
IRkernel from your systemwide Jupyter and add a symlink
to it in $SAGE_LOCAL/share/jupyter/kernels
?
Related:
Replying to @slel:
[ Snip... ]
Did you try symlinking the other way, i.e. find the IRkernel from your systemwide Jupyter and add a symlink to it in
$SAGE_LOCAL/share/jupyter/kernels
?
I tried that (documented in the description), and it doesn't work (same symptoms as with "normal" installation : R appears in the menu for "new sheet", opens a new (blank) tab, that remains totally inactive. No sifgn of life in the cosole where I have done "sagemath -n jupyter" either).
Have you tried to set JUPYTER_PATH
in the sage environment to point to the folder where the system's kernel are located?
https://jupyter-client.readthedocs.io/en/stable/kernels.html
Dependencies: #30124
Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
TL:DR : Sage's Jupyter cannot use a systemwide R IRkernel (correctly installed and usable from a systemwide jupyter notebook).
Current situation :
Kernels:
Symptoms :
jupyter notebook
], the R kernel behaves normally :sage -n jupyter
) :Attempts to install the
r_jupyter
spkg failed :root
The availability of R from Sage's notebook should reduce the need for the systemwide Jupyter(ditto for the other Sage-created Jupyter kernels).
Alternatively, the availability of the Sage kernel from the systemwide notebook would reduce (eliminate ?) the need for Sages's Jupyter (this currently fails, the documentation can't be found during kernel's installation).
//Sidenote :// the
r_jupyter
spkg downloads the Github version ofIRkernel
. This is outdated,IRkernel
being on CRAN since late 2019 : this version should probably be preferred, if only for stability/availability reasonsDepends on #30124
Component: notebook
Issue created by migration from https://trac.sagemath.org/ticket/30120