Is it possible to pretty print sympy formulas?

In development environments like Spyder or Jupyter Notebook the following code

from sympy import *
init_printing()

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

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?

3 comments
Comment actions Permalink

It seems that the latest version of sympy available in https://pypi.python.org/simple 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.

0
Comment actions Permalink

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

0
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 https://youtrack.jetbrains.com/issues/PY

0

Please sign in to leave a comment.