The best practices for using SageNB in SagaMath 9.1?

79 views
Skip to first unread message

unread,
Nov 17, 2020, 1:07:34 PM11/17/20
to sage-support
Hi,  I maintain a  SageNB server since 2011. But as you know, SageMath has droped the support of SageNB on Python3. Now I want to run SageNB in SagaMath 9.1. But I failed many times. 

I follows the codes  by Samuel Lelièvre given  in

make configure 
./configure --with-python=2 --enable-sagenb=yes
 make -s V=0

I have tried the source "sage-9.1.tar.gz" and  the tag9.1 source in  github. I test on Archl linux and Ubuntu 18.04.  I always get the following error. 

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_6.py", line 8, in <module> _interact_.SAGE_CELL_ID=1 NameError: name '_interact_' is not defined


This problem may be caused by the codes in sage/local/lib/python2.7/site-packages/sagenb-1.1.3-py2.7.egg/sagenb/notebook/worksheet.py.  In the line ~3145.

def initialize_sage(self):
  S = self.__sage 
   try: 
       from . import misc
        cmd = '''import base64 
import sagenb.misc.support as _support_ 
import sagenb.notebook.interact as _interact_ 
# for setting current cell id .... ''' 
S.execute(cmd)

I think 'cmd' is not be executed. If I put some error code in 'cmd', there were nothing happened.








Dima Pasechnik

unread,
Nov 17, 2020, 1:44:53 PM11/17/20
to sage-support
Hi,
SageMath never supported SageNB on Python3, it did not "drop" such a support.
SageNB has been retired since SageMath stopped supporting Python2 in version 9.2, and it is high time to switch to
another notebook solution, while converters from SageNB are readily available.
This should not be a surprise, as a deprecation notice for SageNB has been up since Sage 8.5 (i.e. in 2018), I think,

Having said that, I could also point out that the latest Arch, as well as the latest update of Ubuntu 18.04 have been released after Sage 9.1, so there is absolutely no guarantee that 9.1 would work on them, with Python 2 or 3.

HTH
Dima
> --
> 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 sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/5aff084a-1ad0-48ab-9877-dde13087b289n%40googlegroups.com.

Xie

unread,
Nov 17, 2020, 2:50:28 PM11/17/20
to sage-support
Yes.  I use  Jupyter Notebook   myself. But  I need share with other people sometimes.  And  Jupyter Notebook  does not provide a server mode to make the others register an  account.  Most students use Windows, which is not very friendly to SageMath.   I also tried Cocalc in  Docker. Its UI   is a bit complicated for newbie.
In addition, Ubuntu 18.04 and Archlinux can run SageMath 8.9 without problems.  Now I use  SageMath 8.9 on 
a Ubuntu 18.04   server to run SageNB.

Dima Pasechnik

unread,
Nov 17, 2020, 6:07:29 PM11/17/20
to sage-support
On Tue, Nov 17, 2020 at 2:50 PM Xie <xiehon...@gmail.com> wrote:
Yes.  I use  Jupyter Notebook   myself. But  I need share with other people sometimes.  And  Jupyter Notebook  does not provide a server mode to make the others register an  account. 

what you need is

Here are SageMath-specific instructions: https://opendreamkit.org/2018/10/17/jupyterhub-docker/
(there conda is recommended, and perhaps it is indeed the quickest way to get everything set up)

The SageMath docs on this are not complete, but there is work being done on it:


 

Xie

unread,
Nov 18, 2020, 2:42:37 AM11/18/20
to sage-support
Thanks, but jupyterhub  does not supoort  real-time collaboration now though  roadmap  contains  this.

Dima Pasechnik

unread,
Nov 18, 2020, 9:04:02 AM11/18/20
to sage-support
On Wed, Nov 18, 2020 at 2:42 AM Xie <xiehon...@gmail.com> wrote:
Thanks, but jupyterhub  does not supoort  real-time collaboration now though  roadmap  contains  this.
there was no RTC (2+ people working on the same sheet in real time) in sageNB either, if I recall right.
The jupyter roadmap is via jupyterlab, I think.


Xie

unread,
Nov 18, 2020, 12:52:14 PM11/18/20
to sage-support
Yes. If one people  edit the notebook  then the other's browser will auto refresh.  Not a very good experience, just works.

John H Palmieri

unread,
Nov 19, 2020, 5:19:44 AM11/19/20
to sage-support
I was hoping that it might be missing dependencies when building sagenb, but when I tried this, it didn't help. Maybe something this will work:

./configure --with-python=2 --enable-sagenb=yes --enable-flask_autoindex=yes --enable-flask_babel=yes --enable-flask=yes --enable-flask_oldsessions=yes --enable-flask_openid=yes --enable-flask_silk=yes --enable-twisted=yes --enable-speaklater=yes

followed by

make

(When we switched to Python 3, we made various packages optional, some of which are necessary for sagenb. We didn't record them as dependencies of sagenb, so "--enable-sagenb=yes" is not sufficient to build them.)
Reply all
Reply to author
Forward
0 new messages