0

我正在尝试运行这行代码以使用 pylatex 生成报告:

doc.generate_pdf(report_name, clean_tex=True)

当我使用 Spyder 和 Jupyter Notebook 执行程序时,这可以很好地生成一个没有任何错误的 pdf 文件,但是当我尝试使用 Crontab 通过每天执行完全相同的 py 文件来自动化我的任务时,

0 6 * * * cd /Users/me/my_folder && /anaconda3/bin/python3 MyProgram.py

通过终端邮件发生以下错误:

Traceback (most recent call last):
File "MyProgram.py", line 255
doc.generate_pdf(report_name, clean_tex=True)
File "/anaconda3/lib/python3.7/site-packages/pylatex/document.py", line 299, in generate_pdf
'No LaTex compiler was found\n'
pylatex.errors.CompilerError: No LaTex compiler was found
Either specify a LaTex compiler or make sure you have latexmk or pdfLaTex installed.

我花了几个小时在线搜索解决方案,但仍然无法修复错误。所以我想得到一些帮助。提前致谢。

4

0 回答 0