I created a program in Python (PyQT5 Gui) which compiles a LaTeX file to PDF through subprocess.Popen (with LaTeX pre-installed). Everything works fine if I create an application with pyinstaller on MacOS which runs within Terminal. However, if I create the app including the option --windowed
/--noconsole
, the command latex
does not work anymore and the PDF cannot be created.
I understand that I can locate latex
via which latex
and include the path in my Python file. Yet, it should work on any device, regardless where it is installed.
How can I fix this, so that it works on any MacOS, no matter where the latex executable is located (given it is pre-installed)? Thank you for your help!