Is sympy pretty printing broken in new jupyter notebook?

一笑奈何 提交于 2019-12-18 15:57:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/32010945/is-sympy-pretty-printing-broken-in-new-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!