WorksForMe(TM) in Sage 9.5, in both Jupyter and Jupyterlab... HTH, Le mercredi 2 février 2022 à 18:42:48 UTC+1, dsfitz...@gmail.com a écrit :
> I'm teaching a linear algebra course where we use the Sympy Python package > for a lot of the computations. This includes a PreTeXt textbook where there > are Sage Cells throughout, with sample code supplied. > > Until today (I think it was working yesterday), I've had no trouble > running code like the following: > > from sympy import Matrix, init_printing > init_printing() > A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]]) > display(A.rref()) > > The init_printing function from Sympy renders the output in MathJax rather > than pretty-printed plain text, which is nice for teaching. I can run this > with the language set to either Sage or Python. (the 'display' command is > only needed for Python, which is funny, because it is not needed in Jupyter > with a Python kernel.) > > Right now this code throws about 50 lines of error messages; the main > error is a Type Error: > > TypeError: Object of type <class 'bytes'> with value of '(a very, very > long string that I won't reproduce here)' is not JSON serializable > > Was there a change made today that would cause this error? Maybe in the > Sympy library? If I remove the init_printing() line, everything works, > except that there's no longer nice display for the output. > > The reason for using Python syntax is that we also do labs in Jupyter > notebooks. Our institution has a Jupyter hub with Python and R kernels, but > no Sage kernel. (We do not have a CoCalc subscription.) > > I know there is a Sage equivalent to init_printing (although I forget what > it is) but that won't work on the Jupyter side. > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/9c7e9ce1-b339-4cd2-a7e8-84e1581596ccn%40googlegroups.com.