A community-maintained Python framework for creating mathematical animations. https://www.manim.community
  • Python 98.2%
  • GLSL 1.6%
  • Dockerfile 0.1%
Find a file
2020-05-19 21:59:14 -04:00
.github Change a word 2018-12-04 17:24:02 -08:00
docs Documentation typo in constants.rst, fixes issue #814 2019-12-05 00:23:34 +00:00
logo Logo (#537) 2019-05-15 20:03:51 -07:00
manimlib remove more unnecessary files 2020-05-19 21:33:20 -04:00
.gitignore tweaking some diffyq content 2019-07-24 20:37:07 -07:00
example_scenes.py Merge pull request #542 from kyarik/patch-1 2019-05-24 15:15:12 -07:00
LICENSE change copyright holder 2020-05-19 21:59:14 -04:00
manim.py Remove livestreaming option 2020-04-16 23:59:22 -07:00
README.md Remove docker instructions from README.md 2020-05-19 14:02:50 -07:00
requirements.txt Code() in file Code_mobject.py to display code with color highlighted added Paragraph() and "exact_spaces" parameter to Text() (#1036) 2020-05-13 22:19:09 -07:00

logo

Build Status Documentation MIT License Manim Subreddit Manim Discord

Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as seen in the videos at 3Blue1Brown.

Installation

Manim runs on Python 3.7. You can install it from PyPI via pip:

pip3 install manimlib

System requirements are cairo, ffmpeg, sox, latex (optional, if you want to use LaTeX).

You can now use it via the manim command. For example:

manim my_project.py MyScene

For more options, take a look at the Using manim sections further below.

Directly

If you want to hack on manimlib itself, clone this repository and in that directory execute:

# Install python requirements
python3 -m pip install -r requirements.txt

# Try it out
python3 ./manim.py example_scenes.py SquareToCircle -pl

Directly (Windows)

  1. Install FFmpeg.

  2. Install Cairo. For most users, pycairo1.18.0cp37cp37mwin32.whl will do fine.

    pip3 install C:\path\to\wheel\pycairo1.18.0cp37cp37mwin32.whl
    
  3. Install a LaTeX distribution. MiKTeX is recommended.

  4. Install SoX.

  5. Install the remaining Python packages. Make sure that pycairo==1.17.1 is changed to pycairo==1.18.0 in requirements.txt.

    git clone https://github.com/3b1b/manim.git
    cd manim
    pip3 install -r requirements.txt
    python3 manim.py example_scenes.py SquareToCircle -pl
    

Anaconda Install

  • Install sox and latex as above.
  • Create a conda environment using conda env create -f environment.yml
  • WINDOWS ONLY Install pyreadline via pip install pyreadline.

Using virtualenv and virtualenvwrapper

After installing virtualenv and virtualenvwrapper

git clone https://github.com/3b1b/manim.git
mkvirtualenv -a manim -r requirements.txt manim
python3 -m manim example_scenes.py SquareToCircle -pl

Using manim

Try running the following:

python3 -m manim example_scenes.py SquareToCircle -pl

The -p flag in the command above is for previewing, meaning the video file will automatically open when it is done rendering. The -l flag is for a faster rendering at a lower quality.

Some other useful flags include:

  • -s to skip to the end and just show the final frame.
  • -n <number> to skip ahead to the n'th animation of a scene.
  • -f to show the file in finder (for OSX).

Set MEDIA_DIR environment variable to specify where the image and animation files will be written.

Look through the old_projects folder to see the code for previous 3b1b videos. Note, however, that developments are often made to the library without considering backwards compatibility with those old projects. To run an old project with a guarantee that it will work, you will have to go back to the commit which completed that project.

While developing a scene, the -sp flags are helpful to just see what things look like at the end without having to generate the full animation. It can also be helpful to use the -n flag to skip over some number of animations.

Documentation

Documentation is in progress at eulertour.com/docs.

Walkthrough

Todd Zimmerman put together a tutorial on getting started with manim, which has been updated to run on Python 3.7.

Help With Usage and Installation

The issues board is reserved for bugs, and future features planned for Manim. If you need help installing or using Manim, please take a look at the Reddit Community or the Discord Community

Contributing

Is always welcome. In particular, there is a dire need for tests and documentation.

License

All files in the directory from_3b1b, which by and large generate the visuals for 3b1b videos, are copyright 3Blue1Brown.

The general purpose animation code found in the remainder of the repository, on the other hand, is under the MIT license.