ManimGL Setup Guide (Mac) - jwaldorf05/quantum-animation-toolbox GitHub Wiki
Manim is an open-source python library by Grant Sanderson to create math animations for his YouTube channel 3Blue1Brown. Manim is divided into the user-friendly community version ManimCE and the more powerful but less documented ManimGL. In this tutorial you will learn how to configure and effectively use ManimGL.
ManimGL is the version of version of Manim used by Grant Sanderson, which has features based on OpenGL making it much faster at rendering than the community version. It includes jupyter notebook style functionality, where checkpoints can be inserted into your code so that the frame at that specific point is saved and you can run code from this frame until your cursor line to prototype small changes rapidly.
Python 3.13.4 manimpango 0.6.0 manimgl 1.7.2 audioop-lts (long term support)
Before we begin, we’d like to make sure to be on the newest python version, so that the commands I use on this tutorial work on your console as well. I am using Python 3.13.4
although newer versions should work fine as well. ManimGL requires at least Python 3.8
to function. To update your python:
- Go to the Official Python Page
- Click the big download button that says “Latest Version”
- Open the PKG and go through the installation instructions, then you should be good to go!
- Open your spotlight by pressing
Command + SPACE
and open terminal - Check which python version you’re running by typing
python -V
and pressingENTER
- paste the following command into the window that pops up, which will install Homebrew:
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
- Next use the command
brew install ffmpeg mactex
which will required packages - Make sure you’re in the directory where you want to install manim, for me this is my OneDrive folder so I would type
cd OneDrive\\ -\\ QuEra\\ Computing
which puts me into my OneDrive folder - Create a folder to hold all your Manim stuff by running
mkdir Manim_Stuff
- Enter this folder with
cd Manim_Stuff
- Create a virtual environment by typing
python -m venv venv
. This will be where we install all our remaining packages and our python version. - Activate the virtual environment by running
source venv/bin/activate
- Run
pip install manimgl manimpango audioop-lts setuptools
- To test that your installation worked, run
manimgl
. If this is working properly, a blank popup should appear that you can close.
If you’re reading this tutorial I’m sure you’re a fan of 3Blue1Brown and his iconic Computer Modern font (which is also the default font of LaTeX!), which does not come installed on Mac by default. If you want to use this font in your videos, here are the instructions to get it running on your computer.
- Go to this link and click download font for free
- Open the .zip file that downloads to your computer
- Press
Command + SPACE
and typeFont Book
- Open Font Book and drag the .ttf files inside the
cmu-serif
folder into the Font Book window
Once you’re making text objects in your Manim code, make sure to specify the font being used:
helloworld = Text("Hello world", font="CMU Serif")
Or if you want text to be in the Computer Modern font by Default, you can use the snippet:
class CMText(Text):
def __init__(self, text, **kwargs):
kwargs.setdefault("font", "CMU Serif")
super().__init__(text, **kwargs)
And then use the CMText
object instead of Text
.
In addition we can download the fonts used for QuEra templates, which are variants of Radion B.
- Go to this link and scroll down to click
download
onRadion B Regular
,Radion B Italic
,Radion B Book
,Radion B Book Italic
,Radion B Demi
, andRadion B Demi Italic
- Open all the .zip files, each one should give you a
.otf
file - Press
Command + SPACE
and typeFont Book
- Open Font Book and drag the
.otf
files into the Font Book window
Just like with Computer Modern, you will be able to choose these fonts for your Text()
objects.
Grant’s Manim setup uses Sublime, a lightweight code editor that he’s configured for an optimized workflow. In this tutorial we will go through how to setup grant’s workflow which will allow you to render snippets and edits to your manim scene in real time using checkpoints, which is far more efficient than remaking the scene for every little change you make.
Grant’s workflow and keybinds can be found here
- Install Sublime by going to this link and clicking “Install for Mac”, open the .DMG file and add to applications folder
- Open a Sublime window
- Press
Command + Shift + P
and then typePackage Control: Install Package
and click on it - Type
Terminus
and click on it - Press
Command + Shift + P
and then typePackage Control: Enable Package
and click on it - Type
Terminus
and click on it - Quit and Reopen Sublime
- Open a new finder window, and press
Command + Shift + G
- Type in
~/Library/Application Support/Sublime Text/Packages/User
and hit enter - Go to this github link, download and copy the files in this folder into the finder folder you just opened
- Go back to your Sublime window and go to the menu bar at the top of the screen and click
Sublime Text > Settings > Key Bindings
- Click on the tab on the right side, and replace the empty brackets with this:
[
{ "keys": ["shift+super+r"], "command": "manim_run_scene" },
{ "keys": ["super+r"], "command": "manim_checkpoint_paste" },
{ "keys": ["super+alt+r"], "command": "manim_recorded_checkpoint_paste" },
{ "keys": ["super+ctrl+r"], "command": "manim_skipped_checkpoint_paste" },
{ "keys": ["super+e"], "command": "manim_exit" },
{ "keys": ["super+option+/"], "command": "comment_fold"}
]
- Save with
Command + S
and close out of this window
Keybind | Action |
---|---|
CMD + Shift + R | Run scene at current cursor position |
CMD + R | Paste a checkpoint command into the Terminus shell |
CMD + Option + R | Paste a recorded checkpoint (record=true) |
CMD + CTRL + R | Paste a skipped checkpoint (skip=True) |
CMD + E | Quit the Manim/IPython session in Terminus |
CMD + Option + / | Fold selected comment blocks for readability |
A checkpoint is a custom command like checkpoint_paste()
sent to the Terminus terminal. It serves as a visual and semantic marker to document which lines were just run, often labeled with comments and the number of lines selected.
Sublime is a rather lightweight bare-bones code editor and given ManimGL’s lack of documentation I find it useful to be able to easily find the definitions of different classes and functions within Manim. This can be most easily done through the use of LSP (Language Server Protocol). Here is how you get LSP running on Sublime:
- Open a Sublime window
- Press
Command + Shift + P
and then typePackage Control: Install Package
and click on it - Type
LSP
and click on it - Repeat steps 2-3 for
LSP-pyright
(Python) andLSP-TexLab
(LaTeX) - In your virtual environment run
python -c "import sys; print(sys.prefix)"
, this should give the full path to your virtual environment which for me is:/Users/jonathanwaldorf/Library/CloudStorage/OneDrive-QuEraComputing/Manim_Stuff/venv
- Press
Command + Shift + P
and then typePreferences: LSP-pyright Settings
and click on it - Replace the brackets with:
{
"settings": {
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
"[VENV LOCATION]/lib/[PYTHON VERSION]/site-packages"
],
"python.pythonPath": "[VENV LOCATION]/bin/python"
}
}
Where [VENV LOCATION]
is the virtual environment location you got in step 5 and [PYTHON VERSION]
is your python version in the virtual environment. If you can’t remember the python version, go back in your virtual environment and type python3 --version
- Save this file by pressing
COMMAND + S
and close out of this window - Quit and restart Sublime.
Once all of the above configuration is installed, you can finally start making Manimations!
- Open a Sublime window
- Go to the menu bar at the top of the screen and click
File > Open
or useCommand + O
- Go to your manim animations folder, (which should be inside a larger folder alongside
venv
andmanim
) for me it’s atOneDrive > Manim_Stuff > Animation Projects
and clickOpen
- Press
Command + N
to make a new file, then click onPlain Text
in the bottom-right corner and replace it withPython
- Create your Manim animation, or use this code snippet from the quickstart guide instead:
from manimlib import *
class CreateCircle(Scene):
def construct(self):
circle = Circle()
circle.set_fill(BLUE, opacity=0.5)
circle.set_stroke(BLUE_E, width=4)
self.add(circle)
self.play(circle.animate.shift(RIGHT), run_time=1) # Move circle to right
- Save your file with
Command + S
, name the filecircletest.py
, make sure that you’re in your manim animations folder, which for me isOneDrive > Manim_Stuff > Animation Projects
and then hit save. - Go to the menu bar at the top of the screen and click
File > New Window
- Click on this new window and then use
Command + Shift + P
and then typeTerminus: Open Default Shell in Panel
- You should currently be in your main folder, denoted by
~
. Use the commandscd <FOLDERNAME>
(enters FOLDERNAME) andls
(shows what folders are inside your current directory) to get into the folder containing your virtual environment. For me this isOneDrive\\ -\\ QuEra\\ Computing > Manim_Stuff
- Activate your virtual environment using
source venv/bin/activate
- Go into your manim animations folder, which for me would be
cd Animation_Projects
- Type
manimgl -pql circletest.py CreateCircle
and press enter - Click on the window that pops up and hit the spacebar
- Congratulations, you’ve made your first animation!
As it turns out, you can actually play with the scene you just made! One nice advantage of ManimGL is that the scenes you make are interactive, rather than a static video file. After clicking on the window with the circle:
- If you press
f
and move your mouse, you can pan around the scene you made - If you press
d
and move your mouse, you can rotate the camera angle of your scene. While our manim code inherits from theScene
class (which constrains all Manim objects to be in the 2D plane the camera faces) rather thanThreeDScene
, scenes rendered in ManimGL are all rendered in a 3D environment that we can explore to see the scene from multiple angles - If you press
z
and use your scroll wheel, you can zoom in and out in your scene. (When I click on the scene and use my scroll wheel it seems to zoom in and out anyway so I’m not sure this is necessary) - Pressing
r
resets the camera to the standard camera position
To exit the scene, press the ESCAPE
key, or use COMMAND + E
You can also test small changes to your scene and see them in real time without re-rendering the whole scene! Let’s say we have this code:
from manimlib import *
class Circle_Square(Scene):
def construct(self):
circle = Circle()
circle.set_fill(BLUE, opacity=0.5)
circle.set_stroke(BLUE_E, width=4)
self.add(circle)
self.play(circle.animate.shift(RIGHT), run_time=1)
self.wait(1)
square = Square()
square.set_fill(RED, opacity=0.5)
square.set_stroke(RED_D, width=4)
self.add(square)
self.play(square.animate.shift(LEFT), run_time=1)
When we run this scene, we see that a blue circle is created that moves right, and a red square is made that moves left.

What if we wanted to try having the circle move up instead of to the right, without affecting the rest of the animation? First we can go to line 10 of our program and change the line to read self.play(circle.animate.shift(2*UP), run_time=1)
. To test this change, we could put our cursor at the end of the modified line:

and then press COMMAND + SHIFT + R
to run the code up to the point on your cursor! All animations up to this point happen instantaneously so we are only shown the final frame of the scene up to this point:

This command also creates a python terminal within our Login Shell which looks like this:

In this terminal, we can type python commands that will be executed on the scene! This is awesome for prototyping, for instance if I want to make the circle green I can type in this command: circle.set_color(RED)
which will turn the circle on the screen red:

to exit this preview mode, we can press COMMAND + E
or type exit
in the python terminal. Generally if we want to enter the interactive shell in a scene, we can add the command self.embed()
as the last line of our manim scene.