-2

I just start learning manim and Im not so good at python. when I was running manim examples given by the manim kindergarten, there was a error about index but I really don't know how to solve it. As follows manimgl example_scenes.py OpeningManimExample Here is the information

Traceback (most recent call last):
  File "D:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\Python310\Scripts\manimgl.exe\__main__.py", line 7, in <module>
  File "C:\Users\10447\Desktop\manim\manimlib\__main__.py", line 25, in main
    scene.run()
  File "C:\Users\10447\Desktop\manim\manimlib\scene\scene.py", line 148, in run
    self.construct()
  File "C:\Users\10447\Desktop\manim\.\example_scenes.py", line 14, in construct
    intro_words = Text("""
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\text_mobject.py", line 425, in __init__
    super().__init__(
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\text_mobject.py", line 130, in __init__
    super().__init__(text, height=height, **kwargs)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\string_mobject.py", line 68, in __init__
    super().__init__(
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 76, in __init__
    self.init_svg_mobject()
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 104, in init_svg_mobject
    submobs = self.mobjects_from_file(self.get_file_path())
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\string_mobject.py", line 115, in mobjects_from_file
    submobs = super().mobjects_from_file(file_path)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 132, in mobjects_from_file
    return self.mobjects_from_svg(svg)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 187, in mobjects_from_svg
    mob = self.path_to_mobject(shape)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 240, in path_to_mobject
    return VMobjectFromSVGPath(path, **self.path_string_config)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 306, in __init__
    super().__init__(**kwargs)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\types\vectorized_mobject.py", line 113, in __init__
    super().__init__(**kwargs)
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\mobject.py", line 110, in __init__
    self.init_points()
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 314, in init_points
    self.handle_commands()
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\svg\svg_mobject.py", line 352, in handle_commands
    if self.has_new_path_started():
  File "C:\Users\10447\Desktop\manim\manimlib\mobject\types\vectorized_mobject.py", line 502, in has_new_path_started
    return self.consider_points_equal(points[-3], points[-2])
IndexError: index -3 is out of bounds for axis 0 with size 0

It seems that the problem is about vectorized_mobject.py.

I've search all google but it seems no one has the same problem like mine. In the docs of manim kindergarten I found no solution. Hopefully some here once had the same problem and please let me know how to solve it. Really thanks if someone could help me.

  • **DO NOT** post images of code, links to code, data, error messages, etc. - copy or type the text into the question. Please edit your question to include the complete error report starting with the word **traceback**. You can surround the report with 3` before and 3` after to properly format the output. Please edit your question to show a minimal reproducible set. See [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example "Minimal Reproducible Example") for details. – itprorh66 Jan 23 '23 at 15:43
  • Please provide enough code so others can better understand or reproduce the problem. – shamnad sherief Jan 23 '23 at 16:15
  • Sorry for asking an improper question, just start to use stack overflow – 拉格朗日插值多项式 Jan 24 '23 at 03:19

1 Answers1

0

If you want to use Manim. I'd suggest you install ManimCE version from Manim Community. As it is more stable.

If you want to use, Manimgl to reproduce the animations from 3b1b videos.

  1. Make sure you have FFmpeg and latex properly installed (Using Miktex? make sure you enable it to install tex packages on it's own or install all the latex packages).
  2. Create a python virtual environment. Enable the venv you have just created.
  3. Install manim using pip with pip install manimgl. Don't install it from the source, as there are still some bugs at the time of writing.

If you followed all the steps correctly then running manimgl example_scenes.py OpeningManimExample should work.

Martis
  • 26
  • 5