Search code examples
pythonmanim

Manim doesn't produce video


When running scene.py (taken from the Community Manim docs):

from manim import *

class CreatingMobjects(Scene):
    def construct(self):
        circle = Circle()
        self.add(circle)
        self.wait(1)
        self.remove(circle)
        self.wait(1)

class VectorArrow(Scene):
    def construct(self):
        dot = Dot(ORIGIN)
        arrow = Arrow(ORIGIN, [2, 2, 0], buff=0)
        numberplane = NumberPlane()
        origin_text = Text('(0, 0)').next_to(dot, DOWN)
        tip_text = Text('(2, 2)').next_to(arrow.get_end(), RIGHT)
        self.add(numberplane, dot, arrow, origin_text, tip_text)

with python -m manim scene.py CreatingMobjects -p -ql, everything works fine and the movie pops up as it should.

However, if I run the command python -m manim scene.py VectorArrow -p -ql, it doesn't work, with the error: .../partial_movie_file_list.txt: Invalid data found when processing input and the file .../VectorArrow.mp4 does not exist.

Why does the first scene output a video but not the second?


Solution

  • Add self.wait(1) after the self.add(numberplane, dot, arrow, origin_text, tip_text). Then script should work.