FileNotFoundError: No such file or directory: 'pdflatex' when running Python script

Hello, I’m encountering a FileNotFoundError in my Python script when attempting to run pdflatex using subprocess.run. The error message indicates that the pdflatex executable cannot be found:

FileNotFoundError: [Errno 2] No such file or directory: 'pdflatex'

Here’s the relevant portion of my code:

subprocess.run(['pdflatex', '-output-directory', email_dir, main_tex], check=True)
1 Like

If it’s a native dependency and it’s not installed as part of our Native runtimes then you’d need to be using Docker to ensure it’s available.

1 Like

That’s exactly what I did, stuck everything in a docker image, works like a charm, thank you!

1 Like