[Tex/LaTex] How to add the Latex on python path

installingmatplotlibpython

I'm using Cent OS i386. I got a error message when I use matplotlib python package.

RuntimeError: LaTeX was not able to process the following string: 'lp'

So, I did yum install tetex. but it still has error.

It seems to I must add the path of LaTeX on python. But, I don't know where is LaTeX directory and which one is added to Python PATH.

Thank you for reading this.

Best Answer

I encountered the same problem. The PATH variable that is set in my shell is correct and included my custom bin dirs, including Latex. However the one "seen" by Python doesn't. Here is what I'm using:

import os
os.environ["PATH"] += os.pathsep + '/usr/local/texlive/2015/bin/x86_64-darwin'
print(os.getenv("PATH"))