Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is sympy pretty printing broken in new jupyter notebook?

I have previously used pretty printing of math in the ipython notebook. After upgrading to jupyter (also upgrades many other ipython-related packages), pretty printing no longer works like before. I use this code in the top of my notebooks to set it up:

import sympy as sp
sp.init_printing()

I have also tried this with the use_latex=True and use_latex='mathjax' arguments to init_printing, but that does not help. In all cases, expressions are printed in plain text after upgrading. See https://gist.github.com/josteinbf/78dae5085dec0aa19a48#file-sympy_pp-ipynb for a complete example in the form of a notebook.

There are no error messages or warnings, neither in the notebook nor in the console running jupyter. How to fix (or at least debug) this problem?

like image 447
josteinb Avatar asked Aug 14 '15 13:08

josteinb


1 Answers

I also encountered this issue, the fix is to upgrade your sympy version. I found that 0.7.6 reproduces the error, but 0.7.7 has it fixed. At the moment this isn't available via pip, but can be found via the github repo.

like image 129
Greg Avatar answered Sep 29 '22 18:09

Greg