This documentation is for developers who want to contribute to ManimCommunity/manim.
Thank you for your interest in contributing! Please see our documentation on Contributing to take the necessary steps before installing Manim as a developer. This documentation assumes you have already taken the necessary steps to clone your fork.
If you have installed a non-developer version of manim, please uninstall it. This is to avoid any accidental usage of the non-developer version when developing and testing your local copy of the repository. This warning doesn’t apply to users who use poetry (chapter below.)
For Developers with Poetry (Recommended)¶
Poetry can be easily installed in any OS by running the following command:
Linux / OSX / BashOnWindows install instructions¶
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Windows PowerShell install instructions¶
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
Poetry can be installed by other ways also, such as with
If you are using MacOS with the Homebrew package manager, you can also install
brew install poetry.
It will add it to
PATH variable automatically. In order to make sure you have poetry installed correctly, try running:
You may need to restart your shell in order for the changes to take effect.
Installing System Dependencies¶
Please follow the instructions under Installing Manim to install all
ffmpeg, etc.). Afterwards, proceed with the
installation with Poetry.
Windows users can skip the steps to install Pycairo.
Installing Manim using Poetry¶
Use the following command to install python dependencies. This will use the system python:
The first time running this command, poetry will create and enter a virtual environment rooted in the current directory.
For more information, you can visit the poetry documentation.
If you exit the virtual environment, you can reactivate the
Poetryvirtual environment with:
If you only need to run a single command, use:
poetry run <your-command>
Now you are free to start developing!
Running the Tests Using Poetry¶
After completing Installing Manim using Poetry, you can run manim’s test suite
by activating a shell using
poetry shell command and then running the
pytest to run the tests.
poetry shell pytest
You should always run the test suite before making a PR. See Contributing for details.
Code Formatting and Linting Using Poetry¶
Once you are done with Installing Manim using Poetry, you can run the code
black by activating entering the virtual environment:
poetry shell black manim
Or alternatively, without entering the virtual environment:
poetry run black manim
For example, if you have written some new example and want to format it and see lint information use the commands below.
poetry run black example_scenes
Similarly, you can see linting information for a given file, or directory,
black command with
For Developers with pip¶
python3 -m pip install .
Please see Contributing for more details about contributing to Manim.
Since pip doesn’t implement editable installations from our