gpt4 book ai didi

python - Mac 上的 PyLatex 和 pdflatex

转载 作者:行者123 更新时间:2023-12-01 04:43:18 37 4
gpt4 key购买 nike

我一直在考虑用 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,操作系统为 10.10.3 和 Python 3.4.3

最佳答案

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

关于python - Mac 上的 PyLatex 和 pdflatex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30068807/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com