Is it possible to pretty print sympy formulas?

In development environments like Spyder or Jupyter Notebook the following code

from sympy import *

eq = Eq(sympify('(a**2 + sqrt(b)) / log(x)'))

yields this output

whereas in Pycharm you'll end up with this


Is it not possible to display formulas with Pycharm in a more reasonable way?

Comment actions Permalink

It seems that the latest version of sympy available in doesn't have display() function, so I can't reproduce the issue using your code. Please ensure your snippet works and let me know which sympy version you are using.

Comment actions Permalink

Im using Sympy 1.4. display() is not part of sympy, but part of ipython (lib\site-packages\ipython\core\ and therefore should be working in PyCharm.  What error message do you get when you run the code snippet in PyCharm? 

Comment actions Permalink

Yes, thanks for clarifying. 

It seems Jupyter and Spyder use their own libraries to print formulas. PyCharm just use what is available in the shell. You can reproduce it in ipython shell outside of PyCharm and it will look the same, so I guess it should be submitted as feature request. You can do that in our issue tracker


Please sign in to leave a comment.