1. 生成conda配置文件

    conda config --set show_channel_urls yes
  2. 给conda配置清华源
    编辑“.condarc”文件内容如下:

    channels:
      - defaults
    show_channel_urls: true
    default_channels:
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
    custom_channels:
      conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

    运行如下命令清除索引缓存:

    conda clean -i
  3. 创建并激活conda环境

    conda create -n manim
    conda activate manim
  4. 安装ffmpeg

    conda install ffmpeg
  5. 配置pip清华镜像源

    python -m pip install --upgrade pip
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  6. 安装manim动画引擎

    pip install manim
    pip install manimgl   # 可选:安装manimgl
  7. 编写测试程序test_manim_0.py

    from manim import *
    class Try(Scene):
     def construct(self):
         c = Circle(fill_opacity=1)
         s = Square(color=YELLOW, fill_opacity=1)
         self.play(FadeIn(c))
         self.wait()
         self.play(ReplacementTransform(c, s))
         self.wait()
         self.play(FadeOut(s))
         self.wait()
  8. 生成视频动画

    manim .\test_manim_0.py
  9. 补充:安装LaTeX
    通过安装MiKTeX来安装LaTeX
    安装好后,在cmd窗口输入"latex"测试环境变量有没有自动配好,
    如果没有配好,可以手动在Path环境变量中添加“C:\Program Files\MiKTeX\miktex\bin\x64”目录(根据你的MiKTex安装目录进行相应调整)
最后修改:2024 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏