sage kernel in Jupyter and init.sage

79 views
Skip to first unread message

Pierre Guillot

unread,
Nov 16, 2016, 5:52:36 PM11/16/16
to sage-cloud
Hi,

I think it's a known fact that the init.sage file is not read when using sage worksheets (see https://groups.google.com/forum/#!searchin/sage-support/pierre%7Csort:relevance/sage-support/rju_T6XE7EU/m_g2cKLhA_8J), unless this has been changed recently.

However, I have also noticed that the init.sage is not read either when using one of the sagemath kernels in a jupyter notebook. Personally I am compelled to use the python 2 kernel and

%load_ext sage

which actually reads the init.sage, among other things! That's an OK workaround, but then the plots/latex renderings don't work as well (in fact they don't work at all, but i've tweaked something). 

Also, the %load_ext now issues a vexing red message to the effect that "global options are deprecated" -- well it ain't my fault :-)

So, this was to report the issue.

thanks,

Pierre

PS am I the only one having lots and lots of syntaxic sugar in their init.sage? I cannot live without it :-)

William Stein

unread,
Nov 16, 2016, 6:04:43 PM11/16/16
to sage-cloud
On Wed, Nov 16, 2016 at 2:52 PM, Pierre Guillot
<pierre....@gmail.com> wrote:
> Hi,
>
> I think it's a known fact that the init.sage file is not read when using
> sage worksheets (see
> https://groups.google.com/forum/#!searchin/sage-support/pierre%7Csort:relevance/sage-support/rju_T6XE7EU/m_g2cKLhA_8J),
> unless this has been changed recently.

This is

https://github.com/sagemathinc/smc/issues/369

> However, I have also noticed that the init.sage is not read either when
> using one of the sagemath kernels in a jupyter notebook. Personally I am
> compelled to use the python 2 kernel and
>
> %load_ext sage
>
> which actually reads the init.sage, among other things! That's an OK
> workaround, but then the plots/latex renderings don't work as well (in fact
> they don't work at all, but i've tweaked something).
>
> Also, the %load_ext now issues a vexing red message to the effect that
> "global options are deprecated" -- well it ain't my fault :-)
>
> So, this was to report the issue.

Is this a Sage problem or a SageMathCloud problem? The Sage jupyter
kernels are maintained as part of sage, not SMC.

-- William

>
> thanks,
>
> Pierre
>
> PS am I the only one having lots and lots of syntaxic sugar in their
> init.sage? I cannot live without it :-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/40a64b46-c9ca-4459-a202-3dc968537378%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Best Regards,
William Stein

CEO, SageMath, Inc.

Pierre Guillot

unread,
Nov 16, 2016, 6:37:37 PM11/16/16
to sage-cloud

Is this a Sage problem or a SageMathCloud problem?    The Sage jupyter
kernels are maintained as part of sage, not SMC.


Good point. I went to check, so I ran my local sage with the Jupyter notebook for the very first time, and the init.sage was read indeed (I had included a print statement which was ignored, however). So this is an SMC problem ! 

William Stein

unread,
Nov 16, 2016, 10:46:23 PM11/16/16
to sage-cloud
Were the Sage versions the same?

> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/064b28a3-00df-43fd-affb-c90e95249957%40googlegroups.com.

Pierre Guillot

unread,
Nov 16, 2016, 11:16:36 PM11/16/16
to sage-...@googlegroups.com
Ha! my local version was 7.2, and on SMC I was trying 7.4. But 7.3 is
also available, and the bug is not there! so it's something which has
appeared with 7.4, and in all likelihood, it's not related to SMC.

I have my quick fix, i'll just use 7.3 :-)
> You received this message because you are subscribed to a topic in the Google Groups "sage-cloud" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-cloud/eeudalT0zH4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CA%2BjwZMgo9Lw0ex3nS1mv_R4GWUj9cfXbgP0AtE54W%3D3fFP8V0A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Pierre
06 06 40 72 28

William Stein

unread,
Nov 16, 2016, 11:19:16 PM11/16/16
to sage-cloud
You might also report this on sage-devel so it is fixed for sage-7.5.

On Wed, Nov 16, 2016 at 8:16 PM, Pierre Guillot
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CAJ0QLpa7JnwD14U7trRorLdqRCyp%3DfANZLih1Y7g_KHGz0oERA%40mail.gmail.com.

Pierre Guillot

unread,
Nov 17, 2016, 8:05:14 AM11/17/16
to sage-...@googlegroups.com
Amazingly, this morning things are entirely different. Even on 7.4,
the init.sage is correctly read ; but very rapidly I got

ValueError: libGAP: Error, the Small Groups library is required but
not installed

while trying libagp.SmallGroup, which is of course so weird. I'm
pretty definite that yesterday I was using libgap.SmallGroup with the
7.4 kernel (I would notice very rapidly if it weren't there). And I
mean, on SMC all packages are installed...

I guess someone has been changing a few things during the night...??

thanks,
Pierre
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CA%2BjwZMiSBbhy%3D2RShoQwvTw%2BJaR%2Bd0pANz9h_fGD%3Dcbexh_huw%40mail.gmail.com.

Harald Schilly

unread,
Nov 17, 2016, 8:42:10 AM11/17/16
to sage-cloud
On Thu, Nov 17, 2016 at 2:05 PM, Pierre Guillot
<pierre....@gmail.com> wrote:
> I guess someone has been changing a few things during the night...??

Well, I haven't changed anything, and I'm assuming William didn't
either. So, I've no idea what's going on and I can just speculate
around ... e.g. maybe there is something in your .bashrc ?

-- h

Pierre Guillot

unread,
Nov 17, 2016, 8:52:25 AM11/17/16
to sage-...@googlegroups.com
Hi !

> Well, I haven't changed anything, and I'm assuming William didn't
> either. So, I've no idea what's going on and I can just speculate
> around ... e.g. maybe there is something in your .bashrc ?

I never touch that file, and I certainly haven't last night. Also, I
have the same behaviour with both of my "projects" on SMC -- no small
groups library with 7.4. (Is it just me?) And again, i'm pretty sure
it was OK yesterday (I could be wrong on this, there is a small
probability that whenever I was on 7.4 I never used libgap.SmallGroup,
but this would be quite amazing, as the worksheet I was trying as an
example had a call to it in one of the first cells).

I really don't know what happened with the init.sage, either.
Yesterday I was constantly restarting the project to check whether
normal behaviour would be restored, to no effect.

pierre
Reply all
Reply to author
Forward
0 new messages