![How to build manimgl from source on macOS](/blog/thumbnail/cropped.png)
Manim is an engine for precise programmatic animations, designed for creating explanatory math videos.
Download source code
1cd ~/projects2git clone https://github.com/3b1b/manim.git3cd manim
Creating an environment
1conda create -n manim-build-from-source python=3.102conda activate manim-build-from-source
Install libraries
mapbox-earcut
1pip install mapbox-earcut
ffmpeg
1brew install ffmpeg
mactex
1brew install mactex
Verify mactex installation
Type latex --version
in the terminal.
1latex --version2
3# Output4pdfTeX 3.141592653-2.6-1.40.26 (TeX Live 2024)5kpathsea version 6.4.06Copyright 2024 Han The Thanh (pdfTeX) et al.7There is NO warranty. Redistribution of this software is8covered by the terms of both the pdfTeX copyright and9the Lesser GNU General Public License.10For more information about these matters, see the file11named COPYING and the pdfTeX source.12Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.13Compiled with libpng 1.6.43; using libpng 1.6.4314Compiled with zlib 1.3.1; using zlib 1.3.115Compiled with xpdf version 4.04
If the output is as above, then congratulations, mactex has been installed successfully. You can proceed to next step.
Otherwise, please continue. We need to fix this. I’m not sure why, but sometimes, after brew install mactex finishes, it just downloads a package to your disk. You still need to install it manually.
1brew info mactex2
3# Output4❯ brew info mactex5==> mactex: 2024.03126https://www.tug.org/mactex/7Installed8/opt/homebrew/Caskroom/mactex/2024.0312 (5.6GB)9From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/m/mactex.rb10==> Name11MacTeX12==> Description13Full TeX Live distribution with GUI applications14==> Dependencies15ghostscript16==> Artifacts17mactex-20240312.pkg (Pkg)18==> Caveats19You must restart your terminal window for the installation of MacTeX CLI20tools to take effect.21
22Alternatively, Bash and Zsh users can run the command:23
24 eval "$(/usr/libexec/path_helper)"25
26==> Analytics27install: 3,166 (30 days), 7,794 (90 days), 30,329 (365 days)
Copy the highlighted path and open it in the terminal.
1open /opt/homebrew/Caskroom/mactex/2024.031
You will see a file named mactex-<date>.pkg
1tree /opt/homebrew/Caskroom/mactex/2024.03122/opt/homebrew/Caskroom/mactex/2024.03123└── mactex-20240312.pkg4
51 directory, 1 file
Open this file and install it manually.
After the installation is complete, retry Verify mactex installation, now mactex
should work.
Build from source
1pip install -e ./manim
Verify manimgl installation
1which manimgl # output: /opt/anaconda3/envs/manim-build-from-source/bin/manimgl
Use manimgl
1cd ~/projects/manim2manimgl example_scenes.py TexTransformExample
You should be able to see the animation below.
Congratulations, you have completed all the steps.
Additional
If you otherwise encounter problems with installation and use, you can create an Issue at here.
Look through the example scenes to see examples of the library’s syntax, animation types and object types.
In the 3b1b/videos repo, you can see all the code for 3blue1brown videos.