我收到 sh: latex: command not found 错误,当我尝试给 latex 和 manim 发短信时

I got sh: latex: command not found error when try to text latex and manim

$ python3 -m manim example_scenes.py WriteStuff -pl

Media will be written to /Users/pi/Documents/ManimInstall/manim/media/. You can change this behavior with the --media_dir flag.

sh: latex: 找不到命令

Traceback (most recent call last):
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/extract_scene.py", line 155, in main
    scene = SceneClass(**scene_kwargs)
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/scene/scene.py", line 75, in __init__
    self.construct()
  File "example_scenes.py", line 100, in construct
    example_text = TextMobject(
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/mobject/svg/tex_mobject.py", line 147, in __init__
    SingleStringTexMobject.__init__(
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/mobject/svg/tex_mobject.py", line 42, in __init__
    file_name = tex_to_svg_file(
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/utils/tex_file_writing.py", line 21, in tex_to_svg_file
    dvi_file = tex_to_dvi(tex_file)
  File "/Users/pi/Documents/ManimInstall/manim/manimlib/utils/tex_file_writing.py", line 69, in tex_to_dvi
    raise Exception(
Exception: Latex error converting to dvi. See log output above or the log file: /Users/pi/Documents/ManimInstall/manim/media/Tex/c0bd21d57323a926.log

你安装了 Latex 了吗?

错误

sh: latex: command not found

说 manim 试图找到 latex 但找不到。可能你没有安装latex。

假设您使用的是 Ubuntu 或 Debian,运行,

sudo apt install texlive-full

安装 latex 之后一切正常。