Error to generate pdf. Either specify a LaTex compiler or make sure you have latexmk or pdfLaTex installed

4.3k Views Asked by At

I'm facing the same problem as PyLaTeX: pylatex.errors.CompilerError: No LaTex compiler was found but I have not found an answer yet. I´m using Windows and I have the MixTex and pylatex packages installed.

I'm trying first this to then added to other code but is not runnig.

from pylatex import Document, Section, Subsection
from pylatex.utils import italic
import pdflatex

def document(doc):
    geometry_options = {"tmargin": "1cm", "lmargin": "10cm"}
    doc =Document(geometry_options=geometry_options)
    
    with doc.create(Section('Results')):
         doc.append('Something')
    doc.generate_pdf('Results', clean_tex=False, compiler='pdfLaTeX')
    tex = doc.dumps() 

I would like to get some help here. The error is the same:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "generalcode.py", in validation
    doc.generate_pdf('Resultados', clean_tex=False, compiler='pdfLaTeX')
  File "C:Python\Python38-32\lib\site-packages\pylatex\document.py", in generate_pdf
    raise(CompilerError(
pylatex.errors.CompilerError: No LaTex compiler was found
Either specify a LaTex compiler or make sure you have latexmk or pdfLaTex installed.
0

There are 0 best solutions below