Manim命令提示与启动教程有关
我正在为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您发布的错误实际上是您终端中返回的错误,则最有可能的原因是您忘记将文件保存为
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.