windows下安装manim

参考manim文档,一步步来

注:1.整个过程耗时大约30-40分钟,需要耐心等待。

        2.所有项安装到了C盘,还额外安装了python11,如果您的C盘空间充足,可以试一试。如果想安装到其他位置,本教程仅供参考,请自行查阅文档。

        3.没有用anaconda,纯powershell,+pycharm环境

1. 安装Chocolatey

管理员运行powershell,然后输入以下指令,回车,等待几分钟。

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

 等待安装,输出有WARNING警告,但最后没有报错,安装成功

输入

choco

若有绿色回应,则表示成功安装chocolately

 2. 安装manim

powershell下输入

choco install manimce

安装过程出现,要你选择是否继续安装一些东西,输入all即可

整个过程差不多二十分钟

最后给我顺便安装了python3.11,也成功了

 3. 安装latex

powershell继续输入

choco install miktex.install

 安装过程有需要输入all才能进行下一步的操作

4. pycharm环境配置

 创建成功后检查环境:

 上面这个应该有main.py就自动配置好的

5. 运行小例程

参考程序来源官方文档

main.py,填写代码

from manim import *

class CreateCircle(Scene):
    def construct(self):
        circle = Circle()  # create a circle
        circle.set_fill(PINK, opacity=0.5)  # set the color and transparency
        self.play(Create(circle))  # show the circle on screens

打开终端

 输入

manim -pql main.py CreatCircle

有一些无关紧要的warning,但成功生成了mp4动画

猜你喜欢

转载自blog.csdn.net/weixin_52013159/article/details/130550318