For the context: I am on macOS, developing with Spyder. I installed TeX with MACTeX.
I am working on creating an automatic text document and I like to use the solution proposed here: Generating pdf-latex with python script
When excecuting the python script in Spyder, I hang on the line calling "subprocess.Popen(cmd)". The error is:
FileNotFoundError: [Errno 2] No such file or directory: 'pdflatex'"
If I try to execute the command pdflatex
in Terminal, it finds the command and executes it flawlessly.
I probably have a path missing or something similar, though I am puzzled my the error message as it mentions as missing file and I would expect a missing command.
You need to set
shell=True
to get the right shell settings: