Running pdflatex from a python script (3.5.2)
<p>I am trying to run pdflatex from a python script using the subprocess module but for some reason python cannot find the pdflatex module. I can call pdflatex from a command prompt and it works without any issues. I have verified that the path to pdflatex exists under environment variables. I have a MikTex 2.9 installation which works from TexWorks as well as Texstudio. </p>

<p>I have installed the latex package for python (which also uses the subprocess module) but that too cannot find pdflatex.</p>

<p>I am running Win 10 but I can reproduce the problem on Win 7 and Win 8. I had found a solution for Win 7 based on the env parameter but cannot find it now for some reason. </p>

<p>Does anyone have any idea for how to get pdflatex to work properly with Python?</p>

<p>Best regards,</p>

<p>You should try <a href="https://github.com/aclements/latexrun" rel="nofollow">latexrun</a>. This takes care of running all latex related commands.</p>

python subprocess pdflatex