maziarraissi / PINNs

Physics Informed Deep Learning: Data-driven Solutions and Discovery of Nonlinear Partial Differential Equations
https://maziarraissi.github.io/PINNs
MIT License
3.45k stars 1.21k forks source link

RuntimeError: Failed to process string with tex because latex could not be found #13

Open liuhuanhuansky opened 3 years ago

liuhuanhuansky commented 3 years ago

when I run Burgers.py on my personal computer Mac, I have such a problem:

RuntimeError: Failed to process string with tex because latex could not be found

I have downloaded latex and pip install latex, but the problem also exists. I don't know how to solve it.

mariusmerkle commented 3 years ago

I have exactly the same problem - did you fix the issue in the meantime? @liuhuanhuansky

nish-ant commented 3 years ago

The error has to do with the local installations of python and latex and not with the source code in this repository. You might want to raise this question in another forum to get more relevant advice.

However, this is what I can find from the matplotlib documentation:

Matplotlib's LaTeX support requires a working LaTeX installation, dvipng (which may be included with your LaTeX installation), and Ghostscript (GPL Ghostscript 9.0 or later is required). The executables for these external dependencies must all be located on your PATH.

Make sure that PATH contains the location of the executables. Also refer this response to a similar query.

FMagnani commented 3 years ago

If you don't need to process the strings with Latex, you can just run import matplotlib as plt plt.style.use('default') or maybe plt.rcParams.update(plt.rcParamsDefault) just before the plotting section. That's because in the "plotting" module that's imported at the beginning, some modifications are applied to the rcParams. Stuff like this can be difficult to spot, that's a reason for which I don't like when something happens at a global level, due to code hidden inside a harmless import.

NingningSong commented 2 years ago

I have the same problem, have you solved it?

FMagnani commented 2 years ago

I think that you could solve it either modifying the dictionary https://github.com/maziarraissi/PINNs/blob/0542794b0a91b9e8764a38f5fc9cd9647a3929ba/Utilities/plotting.py#L22 or removing the command https://github.com/maziarraissi/PINNs/blob/0542794b0a91b9e8764a38f5fc9cd9647a3929ba/Utilities/plotting.py#L40

NingningSong commented 2 years ago

I think that you could solve it either modifying the dictionary

https://github.com/maziarraissi/PINNs/blob/0542794b0a91b9e8764a38f5fc9cd9647a3929ba/Utilities/plotting.py#L22

or removing the command https://github.com/maziarraissi/PINNs/blob/0542794b0a91b9e8764a38f5fc9cd9647a3929ba/Utilities/plotting.py#L40

Thank you very much