ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
21.45k stars 1.57k forks source link

Google Colab: Video data is no longer automatically embedded in the notebook #3741

Open mathriddle opened 5 months ago

mathriddle commented 5 months ago

Previously, running the command "from manim import *" all by itself in a Colab cell would result in the output "Manim Community v0.18.0". Then the manim code to make a video could be run in additional cells. With v0.18.1, however, no output is generated running that import command, but the "Manim Community v0.18.1" appears as the output after rendering a manim snippet in a subsequent cell, along with the message about "no video with supported format and MIME type found".

Adding the line config.media_embed=True to the cell with the import command does resolve the issue, but the "Manim Community v0.18.1" output still appears as the output along with the now functioning video.

behackl commented 5 months ago

The version spash shown on import has been disabled by default.

As for the video: it actually is being generated, Colab can just not display it if it is not directly embedded into the notebook source. The default behavior of this config option (config.media_embed) has been changed; it is False now by default, None is no longer an allowed value.

The corresponding code that needs to be updated is here: https://github.com/ManimCommunity/manim/blob/31f189519b1e887803be67b76d61e4dc35655252/manim/utils/ipython_magic.py#L172-L176

We should change this such that media_embed is True whenever the IPython magic is run on Colab.