本文介绍了新的jupyter笔记本中的sympy漂亮打印是否损坏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在ipython笔记本中使用过漂亮的数学打印方法.升级到jupyter后(还升级了许多其他与ipython相关的软件包),漂亮的打印不再像以前那样工作.我在笔记本顶部使用以下代码进行设置:

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()

我也使用init_printinguse_latex=Trueuse_latex='mathjax'参数尝试了此操作,但这无济于事.在所有情况下,升级后,表达式均以纯文本打印.参见 https://gist.github.com/josteinbf/78dae5085dec0aa19a48#file-sympy_pp- ipynb 以笔记本的形式提供完整示例.

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.

在笔记本计算机或运行jupyter的控制台中都没有错误消息或警告.如何解决(或至少调试)此问题?

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?

推荐答案

我也遇到了此问题,解决方法是升级您的sympy版本.我发现0.7.6重现该错误,但0.7.7已修复.目前无法通过pip使用,但可以通过 github存储库找到.

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.

这篇关于新的jupyter笔记本中的sympy漂亮打印是否损坏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 12:07