使用 TexPad 编辑器编译 PythonTeX

使用 TexPad 编辑器编译 PythonTeX

我最近开始使用 PythonTeX,但很难简化我的工作流程。我在 macOS Mojave 下使用最新版本的 TexPad(版本 1.9.2)。我完全能够使用终端在我的计算机上编译 PythonTeX(v. 0.16),但我想使用 TexPad 为我完成构建过程。我使用以下(官方)PythonTeX .tpbuild 脚本。
#!/bin/bash
# Texpad build (.tpbuild) file to use PythonTeX within Texpad
# NB this is to demonstrate pythontex only, it would need alterations to support bibliographies, indices, etc.

pdflatex -synctex=1 "$TEXPAD_ROOTFILE"
pythontex "$TEXPAD_ROOTFILE_NO_EXT"
pdflatex -synctex=1 "$TEXPAD_ROOTFILE"

可以找到这里。但是,如果我尝试编译 PythonTeX 文档,例如

\documentclass{article}
\usepackage{pythontex}
\begin{document}
    2+2=\py{2+2}
\end{document}

在 texpad 中我收到以下错误。

This is TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 623 (preloaded format=latex 2021.3.29)  30 JUN 2021 08:15
**
(testII.tex
LaTeX2e <2017-04-15>
Babel <3.16> and hyphenation patterns for 84 language(s) loaded.
(article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)

! LaTeX Error: File `pythontex.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.3 \begin
          {document}^^M
*** (cannot \read from terminal in nonstop modes)

No pages of output.


This is TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 623 (preloaded format=latex 2021.3.29)  30 JUN 2021 08:15
**
(testII.tex
LaTeX2e <2017-04-15>
Babel <3.16> and hyphenation patterns for 84 language(s) loaded.
(article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)

! LaTeX Error: File `pythontex.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.3 \begin
          {document}^^M
*** (cannot \read from terminal in nonstop modes)

No pages of output.

如果有人能告诉我我做错了什么或者编译失败的原因,那就太好了。谢谢!

相关内容