Manim命令提示与启动教程有关

发布于 2025-02-09 14:20:30 字数 648 浏览 0 评论 0原文

我正在为Manim进行入门教程,这是我的代码:

from manim import * 

class PointMovingOnShapes(Scene):
    def construct(self):
        square = Square(color=BLUE) # Create a square
        square.rotate(-3 * TAU / 8) # Rotate the square -3/8 * 2*PI
        self.play(GrowFromCenter(square))

现在在命令提示符中,我写了 manim -p -ql start.py端子pointmovingonshapes ,我的命令提示符给我这个错误:

class Pith(Scene):
NameError: name 'Scene' is not defined

sideNote:i i i i sidenote:i i 'm使用“ https://towardsdatascience.com/how-to-to-create-mathematical-animation-like-3blue-3blue1brown-- using python-f571fb9da3d1”。

I'm doing the starter tutorial for Manim, and here's my code:

from manim import * 

class PointMovingOnShapes(Scene):
    def construct(self):
        square = Square(color=BLUE) # Create a square
        square.rotate(-3 * TAU / 8) # Rotate the square -3/8 * 2*PI
        self.play(GrowFromCenter(square))

Now in command prompt I wrote manim -p -ql start.py PointMovingOnShapes, and my command prompt gives me this error:

class Pith(Scene):
NameError: name 'Scene' is not defined

sidenote: I'm using "https://towardsdatascience.com/how-to-create-mathematical-animations-like-3blue1brown-using-python-f571fb9da3d1" for my tutorial.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与之呼应 2025-02-16 14:20:30

如果您发布的错误实际上是您终端中返回的错误,则最有可能的原因是您忘记将文件保存为class Pith(scene)在您上面发布的片段中不会出现。

从附带说明,我认为将安装版本修复到0.9.0(因此,您要遵循的本教程)是相当旧的,这不是一个好主意。您可能还可以使用最新版本的大多数(即使不是全部)(如果不是全部)遵循。

If the error you posted is actually what is returned in your terminal, the most likely reason is that you forgot to save your file as class Pith(Scene) does not occur in the snippet you posted above.

And on a side note, I don't think it is a good idea to fix the installed version to 0.9.0, as it (and therefore also this tutorial you are trying to follow) is rather old. You can probably follow most, if not all, of the tutorial with a more recent version as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文