New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an error if matplotlib and latex are not installed when trying to render a png #9962
Comments
Maybe this should be: print using string or pretty printing if they are not installed. |
notebook: Newer versions of notebook load MathJax from the net. It does not matter if neither matplotlib nor latex is available. It will suffice to provide IPython with a latex representation of the output. qtconsole: If matplotlib and latex are not installed, png-data won't be available. If a latex string is provided, qtconsole will then try to use matplotlib. It will not fall back to pretty printing after getting None. (I think this is a bug.) So it seems that, if matplotlib and latex are not installed, we should provide notebook with a latex string but let qtconsole only have the (pretty) string. However, there is a problem. Quoting from this thread:
This leaves the question: which (common) default should be chosen for notebook and qtconsole when both matplotlib and latex are missing, |
I don't necessarily agree with this. I'd like it to "work" without an internet connection too.
Agreed.
Maybe pretty print? But is it possible everything isn't installed for that to work too? Maybe it should just be the simple string rep. |
I was just referring to how the designers of notebook seem to have planned it. An alternative is a local installation of MathJax. But that is big, of course... As to the default, I think text/plain should perhaps be taken even if MathJax could give nicer output in notebook. Anyway, a notebook user will always have the option of running |
A possible plan for IPython notebook and qtconsole printing defaults (when
These defaults may always be overridden by setting |
The upstream bug in the qtconsole has been fixed. See also the related jupyter/qtconsole#95. |
If you enable printing in qtconsole or ipython notebook and you have neither matplotlib or latex (or mathjax) installed you'll get empty pngs, e.g.:
from IPython.lib.latextools import latex_to_png
doesn't seem to raise and error if neither are available.The text was updated successfully, but these errors were encountered: