Google colaboratory 如何在Google Colab上安装manimgl?

Google colaboratory 如何在Google Colab上安装manimgl?,google-colaboratory,manim,Google Colaboratory,Manim,我想在GoogleColab上使用manimgl,但是简单的!pip安装manimgl似乎不起作用。我研究了几种解决方案。特别是: 你有解决办法吗?我找到了一个相对简单的方法。实际上,有一个名为JupyterManim的库,只需做一些调整,就可以很好地工作。以下是我所做的: !apt-get install -qq pkg-config libcairo2-dev !pip3 install jupyter-manim --quiet !sudo apt-get -qq update

我想在GoogleColab上使用
manimgl
,但是简单的
!pip安装manimgl
似乎不起作用。我研究了几种解决方案。特别是:


你有解决办法吗?

我找到了一个相对简单的方法。实际上,有一个名为JupyterManim的库,只需做一些调整,就可以很好地工作。以下是我所做的:

!apt-get install -qq pkg-config libcairo2-dev 
!pip3 install jupyter-manim --quiet
!sudo apt-get -qq update
!sudo apt-get install -qq texlive-full
-qq
只是不获取提示输出

仅供参考,整个安装有点长(约5分钟)

然后,您应该能够运行:

import jupyter_manim
from manimlib.imports import *
import statistics

%%manim OpeningScene --base64
class OpeningScene(Scene):
    def construct(self):
        first_line = TextMobject("Data Structures and Algorithms")
        second_line = TextMobject("Time Complexity and Big O Notation")
        self.play(Write(first_line))
        self.wait(2)
        self.play(Transform(first_line, second_line))
        self.wait(3)
        self.play(FadeOut(first_line))

我从这个笔记本中得到了灵感: