I'm trying to learn PyLatex. I've installed it via pip and copied the basic code from here and I'm getting this issue:
C:\Conner\Scripts>pylatAttempt.py
latexmk: The script interpreter could not be found.
latexmk: Data: scriptInterpreter="perl.exe"
Traceback (most recent call last):
File "C:\Conner\Scripts\pylatAttempt.py", line 23, in <module>doc.generate_pdf()
File "C:\Python27\ArcGIS10.2\lib\site-packages\pylatex\document.py", line 193, in generate_pdf raise(e)
subprocess.CalledProcessError: Command '[u'latexmk', u'--pdf', u'--interaction=nonstopmode', u'basic.tex']' returned non-zero exit status 1
I've downloaded MiKTeX 2.9, do I need anything else? What is going wrong here? From the docs it seems like all you need to install is pylatex.
You can change the compiler to pdflatex instead of latexmk which will work if you have installed miktex and pdflatex . latexmk is compiler by default.
doc.generate_pdf(clean_tex=False,compiler='pdfLaTeX')
If anyone stumbles upon this it turns out that for PyLatex to work you also have to have Perl installed. Once I downloaded Perl from here it worked. Make sure Perl is in the PATH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With