Manim Community v0.5.0的Graph类是否有问题?
我正在使用Pycharm中Manim社区的最新版本 此代码Manim Community v0.5.0的Graph类是否有问题?,graph,manim,Graph,Manim,我正在使用Pycharm中Manim社区的最新版本 此代码 class MovingVertices(Scene): def construct(self): vertices = [1, 2, 3, 4] edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)] g = Graph(vertices, edges) 给出此错误: TypeError: __init__() takes 1 p
class MovingVertices(Scene):
def construct(self):
vertices = [1, 2, 3, 4]
edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)]
g = Graph(vertices, edges)
给出此错误:
TypeError: __init__() takes 1 positional argument but 3 were given
我正在努力理解这个错误。其他示例给出了相同的错误。解决方案:我创建了一个名为graph.py的新文件,并导出了其中的所有代码示例。也许其他py文件产生了我无法解释的冲突。manim0.7.0版本
class MovingVertices(Scene):
def construct(self):
vertices = [1, 2, 3, 4]
edges = [(1, 2), (2, 3), (3, 4), (1, 3), (1, 4)]
g = Graph(vertices, edges)
self.play(Create(g))
self.wait()