Mac 上的 PyLatex 和 pdflatex

PyLatex and pdflatex on Mac

我一直在研究如何在 python 中生成一些简单的 LaTeX 文档,然后我发现了 PyLaTex,它似乎很简单。在它的 PyPi 包页面上,它有一个 运行 的示例脚本。我安装了它和 运行 脚本,但出现以下错误:

/bin/sh: pdflatex: command not found
Traceback (most recent call last):
  File "/Users/Danyon/Documents/Uni/CSSE1001/PyLaTex/plt.py", line 60, in <module>
    doc.generate_pdf()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pylatex/document.py", line 127, in generate_pdf
    subprocess.check_call(command, shell=True)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 561, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'pdflatex --jobname="default_filename" "default_filename.tex"' returned non-zero exit status 127

显然,我没有 pdflatex,但我似乎无法在 Mac 上找到从哪里获得它或如何安装它。 我有一本 Macbook Air w/ OS 10.10.3 和 Python 3.4.3

为了安装pdflatex,你需要安装MacTeX包。你可以在这里找到这个:http://www.tug.org/mactex/