Your snapshot shows the "Sage notebook" and not the "Jupyter notebook". I confirm that with sage-7.5 your code * when executed in the Jupyter notebook (started with "sage --notebook=jupyter") works fine * when executed in the Sage notebook (started with "sage --notebook=sagenb") ends with the same kind of error and traceback
On 23 October 2016 at 22:16, [email protected] <[email protected]> wrote: > > > On Sunday, October 23, 2016 at 1:03:13 PM UTC-4, [email protected] wrote: >> >> Hi the @interact command no longer seems to be working in Sage 7.3 and >> Sage 7.4 on an Mac Book Pro running El Capitan: >> >> Here is the contents I entered in an "Jupyter" notebook cell which I >> copied from a Sage interact example: >> >> ----------------------------------------------------------------------------------- >> Contents of the sage 7.4 notebook cell: >> from ipywidgets import interact, interactive, fixed >> import ipywidgets as widgets >> >> >> @interact(num=5) >> def square(num=2): >> print "{} squared is {}".format(num, num*num) >> >> -------------------------------------------------------------------------------------------- >> >> Here is the error output: displayed in the output cell: >> >> ------------------------------------------------------------------------------------------------------ >> Traceback (most recent call last): print "{} squared is {}".format(num, >> num*num) File "", line 1, in <module> File >> "/private/var/folders/31/r_2f8ryd5ks7xb80nyrbj2cc0000gn/T/tmprIbuu6/___c >> \ ode___.py", line 8, in <module> def square(num=_sage_const_2 ): File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/interaction.py", line 360, in dec >> return interact(f, **kwargs) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/interaction.py", line 343, in >> interact w = interactive(f, **kwargs) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/interaction.py", line 203, in >> interactive container = Box(_dom_classes=['widget-interact']) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget_box.py", line 44, in >> __init__ super(Box, self).__init__(**kwargs) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/domwidget.py", line 90, in >> __init__ super(DOMWidget, self).__init__(*pargs, **kwargs) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget.py", line 184, in __init__ >> self.open() File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget.py", line 197, in open >> state, buffer_keys, buffers = >> self._split_state_buffers(self.get_state()) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget.py", line 291, in >> get_state value = to_json(getattr(self, k), self) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 529, in __get__ return >> self.get(obj, cls) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 508, in get value = >> self._validate(obj, dynamic_default()) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/domwidget.py", line 23, in >> _layout_default return Layout() File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget.py", line 184, in __init__ >> self.open() File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipywidgets/widgets/widget.py", line 203, in open >> self.comm = Comm(**args) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipykernel/comm/comm.py", line 63, in __init__ >> self.open(data=data, metadata=metadata, buffers=buffers) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/ipykernel/comm/comm.py", line 94, in open >> comm_manager = getattr(self.kernel, 'comm_manager', None) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 529, in __get__ return >> self.get(obj, cls) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 508, in get value = >> self._validate(obj, dynamic_default()) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 564, in _validate >> value = self.validate(obj, value) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 1589, in validate >> self.error(obj, value) File >> "/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python >> \ 2.7/site-packages/traitlets/traitlets.py", line 1436, in error raise >> TraitError(e) traitlets.traitlets.TraitError: The 'kernel' trait of a >> Comm instance must be a Kernel, but a value of type 'NoneType' (i.e. >> None) was specified. >> >> >> ---------------------------------------------------------------------------------------------------------------- >> >> Any ideas? >> >> Regards, >> >> Adam Hausknecht >> Department of Mathematics >> UMass Dartmouth > > > > > One idea: Could the an old version of the notebook be running instead of the > Jupyter notebook? Note I am using the app version of Sage 7.4. The menu at > the top of screen indicates > that Jupyter is running.(I've attached a snap of Sage 7.4 notebook ). > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
