【发布时间】:2011-08-30 05:47:30
【问题描述】:
我有以下 Hello World 代码可以在我的 Mac 上尝试使用 matplotlib 进行 TeX 渲染。
import matplotlib.pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
rc('font', family='serif')
plt.text(2,2,r"Hello World!")
plt.show()
使用该代码,我会收到以下错误:
sh: latex: command not found
Exception in Tkinter callback
<... a long Traceback here ...>
RuntimeError: LaTeX was not able to process the following string:
'lp'
Here is the full report generated by LaTeX:
在最后一行之后,我没有看到任何形式的完整报告。无论如何,我认为这是一个路径问题。关于如何修复它的一些指示?我有 TeX Live 2010。
我尝试将 /Library/TeX/Root/bin/universal-darwin 添加到项目属性的全局 Python 路径中,但我仍然遇到相同的错误。
【问题讨论】:
标签: python macos matplotlib tex