Пример установки PyLatex c - PullRequest
       14

Пример установки PyLatex c

1 голос
/ 13 апреля 2020

Извинения, если аналогичный вопрос был опубликован в другом месте. Я пытаюсь переключиться на Python для набора новых проектов, но найти настройку довольно сложно. Для этого я наткнулся на PyLatex, который выглядит многообещающе. Я следовал инструкциям по установке через pip, установил LatexMK и попытался выполнить файл примера basi c, чтобы протестировать его. Это не удалось, выдав мне следующую ошибку:

runfile('/Users/~/.spyder-py3/untitled0.py', wdir='/Users/~/.spyder-py3')
Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
Rule 'pdflatex': File changes, etc:
   Non-existent destination files:
      'basic.pdf'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  --interaction=nonstopmode -recorder  "basic.tex"'
------------
Latexmk: applying rule 'pdflatex'...
sh: pdflatex: command not found
Collected error summary (may duplicate other messages):
  pdflatex: (Pdf)LaTeX failed to generate the expected log file 'basic.log'
Latexmk: Did not finish processing file 'basic.tex':
   (Pdf)LaTeX failed to generate the expected log file 'basic.log'
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets

Traceback (most recent call last):

  File "<ipython-input-24-35bb0f8240b1>", line 1, in <module>
    runfile('/Users/~/.spyder-py3/untitled0.py', wdir='/Users/~/.spyder-py3')

  File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/Users/~/.spyder-py3/untitled0.py", line 32, in <module>
    doc.generate_pdf(clean_tex=False)

  File "/Users/~/opt/anaconda3/lib/python3.7/site-packages/pylatex/document.py", line 233, in generate_pdf
    stderr=subprocess.STDOUT)

  File "/Users/~/opt/anaconda3/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout

  File "/Users/~/opt/anaconda3/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)

CalledProcessError: Command '['latexmk', '--pdf', '--interaction=nonstopmode', 'basic.tex']' returned non-zero exit status 12.

Я использую среду Anaconda с Python 3.7 на Ma c (ОС 10.15.4). То, чего я надеялся добиться, - это создать латексный файл и сгенерировать pdf, как я обычно делал с Latex.

Спасибо за любую помощь!

...