ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 26 Feb 2018 12:16:26 -0600SageMath and interact / ipywidgets with jupyterhttp://ask.sagemath.org/question/41269/sagemath-and-interact-ipywidgets-with-jupyter/I got the SageMath kernel working well inside my anaconda distribution's copy of jupyter, following [these instructions](https://stackoverflow.com/a/41595015), so I can open SageMath notebooks using anaconda jupyter and they run perfectly fine -- almost.
I would like to get interact elements / ipywidgets working when I use SageMath as a kernel in anaconda jupyter, but with my current configuration (hopefully described in sufficient detail below), I get the following error message in the console
>[IPKernelApp] WARNING | Widget Javascript not detected. It may not be installed or enabled properly.
and the notebook simply outputs the initial value of the function with no interactivity.
---
I'm running SageMath 8.1 on macOS. I've been able to get interact elements and ipywidgets with SageMath code running in the SageMath jupyter notebook interface (not sure if this was necessary, but I ran
`/local/bin/jupyter nbextension enable --py widgetsnbextension`
in the SageMath directory.) Everything works as expected, i.e. if I run `sagemath -n jupyter` and open a notebook containing:
>import ipywidgets as widgets
>
>widgets.IntSlider(
value=7,
min=0,
max=10,
step=1,
description='Test:',
disabled=False,
continuous_update=False,
orientation='horizontal',
readout=True,
readout_format='d'
)
I get a slider widget which works.
Similarly, examples from this [interact tutorial](https://wiki.sagemath.org/interact/graphics) on the SageMath wiki run perfectly fine in SageMath jupyter.
I also have an up-to-date anaconda install of jupyter where the ipywidgets nbextension has been enabled; the above ipywidgets code can be run in anaconda jupyter with the ordinary python kernel and works fine.
----
[The real reason I am asking this question is I would like to figure out how to get interactive widgets working in jupyterlab with the SageMath kernel, but I'm guessing that if the above question can be answered, I can get everything else working as well.]j.c.Mon, 26 Feb 2018 12:16:26 -0600http://ask.sagemath.org/question/41269/