Skip to content

Instantly share code, notes, and snippets.

@Macorreag
Last active October 4, 2022 01:36
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Macorreag/abfc02b99a751431d8793e9c5506ef49 to your computer and use it in GitHub Desktop.
Save Macorreag/abfc02b99a751431d8793e9c5506ef49 to your computer and use it in GitHub Desktop.
Configuración de Colab para crear animaciones con la librería de manim
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "AnimacionConManim.ipynb",
"provenance": [],
"private_outputs": true,
"collapsed_sections": [],
"toc_visible": true,
"authorship_tag": "ABX9TyNVZrHGn/g97e+nLpgCkX/5",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/Macorreag/abfc02b99a751431d8793e9c5506ef49/animacionconmani.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "B5IRkt7BYHU1",
"colab_type": "text"
},
"source": [
"# Crear Animaciones usando Manim en Google Colab\n",
"Tutorial de como instalar manim en un entorno de Colab, es necesario descargar las renderizaciones."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "a_41XZkxQzBf",
"colab_type": "text"
},
"source": [
"## Paso 1. Clonar repositorio de manim\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "y5TOPBoFQvI1",
"colab_type": "code",
"colab": {}
},
"source": [
"!git clone https://github.com/3b1b/manim.git"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "L6htmdplRZj2",
"colab_type": "code",
"colab": {}
},
"source": [
"# Cambiarse a la carpeta de manim\n",
"%cd manim"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "KG6lKephHYVL",
"colab_type": "text"
},
"source": [
"## Paso 2. Instalar LaTeX (TeX live)"
]
},
{
"cell_type": "code",
"metadata": {
"id": "NpNUhdQSG_wB",
"colab_type": "code",
"colab": {}
},
"source": [
"!sudo apt-get install texlive-full"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "hSeA9X5lHgxg",
"colab_type": "text"
},
"source": [
"## Paso 3. Usar python 3.7 en el entorno "
]
},
{
"cell_type": "code",
"metadata": {
"id": "pnu_sllpIGJ6",
"colab_type": "code",
"colab": {}
},
"source": [
"!sudo apt-get install python3.7-minimal"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "ieEHD0mEI050",
"colab_type": "text"
},
"source": [
"## Paso 4. Verificar tener PIP instalado\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "15_cKhmjI33W",
"colab_type": "code",
"colab": {}
},
"source": [
"# !python3 get-pip.py\n",
"! mkdir pip\n",
"! cd pip\n",
"! curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py\n",
"! python3 get-pip.py"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "2JQqSL1tP-mU",
"colab_type": "text"
},
"source": [
"## Paso 5. Instalar ffmpeg"
]
},
{
"cell_type": "code",
"metadata": {
"id": "UzFkcj8ZQBfz",
"colab_type": "code",
"colab": {}
},
"source": [
"!sudo apt-get install ffmpeg"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "IkUNhJ9BQNvz",
"colab_type": "text"
},
"source": [
"## Paso 6 Instalar SoX"
]
},
{
"cell_type": "code",
"metadata": {
"id": "qMCXaSVKQSMX",
"colab_type": "code",
"colab": {}
},
"source": [
"!sudo apt-get install sox"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "WaZMHDytQaDL",
"colab_type": "text"
},
"source": [
"## Paso 7. Instalación de paqueterías previas para instalar pycairo:"
]
},
{
"cell_type": "code",
"metadata": {
"id": "hDOTqewHQay0",
"colab_type": "code",
"colab": {}
},
"source": [
"!python3 -m pip install pyreadline\n",
"!python3 -m pip install pydub"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "2ym8MDLSR3LB",
"colab_type": "code",
"colab": {}
},
"source": [
"!sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev python3-dev libffi-dev"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "8DTkZo3gRImY",
"colab_type": "code",
"colab": {}
},
"source": [
"!pip install -r requirements.txt"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "45nIB88-46PT",
"colab_type": "text"
},
"source": [
"## Paso 8. Clone las escenas que desea utilizar dentro de la carpeta manim\n",
"\n",
"Dejamos un ejemplo de un programa de programacion lineal para renderizar."
]
},
{
"cell_type": "code",
"metadata": {
"id": "-xyhbC8m5tLI",
"colab_type": "code",
"colab": {}
},
"source": [
"!git clone https://github.com/Macorreag/SimplexAnimation.git"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "e4Hiwee0ho6L",
"colab_type": "text"
},
"source": [
"## Paso 9. Renderize example "
]
},
{
"cell_type": "code",
"metadata": {
"id": "RCnvAKQXSFuM",
"colab_type": "code",
"colab": {}
},
"source": [
"!python3 -m manim SimplexAnimation/LinealProblemMetodoG.py "
],
"execution_count": null,
"outputs": []
}
]
}
@qo4on
Copy link

qo4on commented Jun 20, 2020

@juanmile4
Copy link

hola tengo problemas en instalar el paso 7 en este item !pip install -r requirements.txt
me genera este error

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gym 0.17.3 requires pyglet<=1.5.0,>=1.4.0, but you have pyglet 1.5.15 which is incompatible.
Successfully installed argparse-1.4.0 colour-0.1.5 glcontext-2.3.2 manimpango-0.2.3 mapbox-earcut-0.12.10 moderngl-5.6.4 moderngl-window-2.3.0 multipledispatch-0.6.0 pyglet-1.5.15 pyrr-0.10.3 screeninfo-0.6.7 validators-0.18.2
WARNING: The following packages were previously imported in this runtime:
[argparse]
You must restart the runtime in order to use newly installed versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment