Pylatex error when generate PDF file - No such file or directory
<p>I just want to use Pylatex to generate the pdf file. I look at the basic example and re-run the script but it raised the error: OSError: [Errno 2] No such file or directory.</p>

<p>Here is my script:</p>

<pre><code>import sys
from pylatex import Document, Section, Subsection, Command
from pylatex.utils import italic, NoEscape


def fill_document(doc):
    """Add a section, a subsection and some text to the document.
    :param doc: the document
    :type doc: :class:`pylatex.document.Document` instance
    """
    with doc.create(Section('A section')):
        doc.append('Some regular text and some ')
        doc.append(italic('italic text. '))

        with doc.create(Subsection('A subsection')):
            doc.append('Also some crazy characters: $&amp;#{}')


if __name__ == '__main__':
    reload(sys)
    sys.setdefaultencoding('utf8')
    # Basic document
    doc = Document()
    fill_document(doc)

    doc.generate_pdf("full")
    doc.generate_tex()
</code></pre>

<p>And the error:</p>

<pre><code>Traceback (most recent call last):
  File "/Users/code/Test Generator/Generate.py", line 34, in &lt;module&gt;
    doc.generate_pdf("full")
  File "/Library/Python/2.7/site-packages/pylatex/document.py", line 227, in generate_pdf
    raise(os_error)
OSError: [Errno 2] No such file or directory
</code></pre>

<p>Can someone help me ? :-D thanks a lot.</p>

<p>Based on the code around the error, you're probably missing a latex compiler:</p>

<pre><code>compilers = (
    ('latexmk', latexmk_args),
    ('pdflatex', [])
)
</code></pre>

<p>Try doing this:</p>

<pre><code>apt-get install latexmk
</code></pre>

python nosuchfileexception