首页 > 解决方案 > Manim Community v0.5.0的Graph类有问题吗?

问题描述

我在 Pycharm 中使用最新版本的 Manim Community

这段代码

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

我正在努力理解这个错误。其他示例给出了相同的错误。

标签: graphmanim

解决方案


解决方案:我创建了一个名为 graph.py 的新文件并导出了里面的所有代码示例。也许其他 py 文件产生了我无法解释的冲突。


推荐阅读