This documentation is for developers who want to contribute to
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 on your local copy of the repository. This warning doesn’t apply for users who use poetry (chapter below.)
Poetry can be easily installed in any OS by running the following command:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
(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
pip. See https://python-poetry.org/docs/#alternative-installation-methods-not-recommended. If you are using MacOS with the Homebrew package manager, you can also install poetry with
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.
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.
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 at the current directory.
For more information you can visit the poetry documentation.
If you exit the virtual environment, you can reactivate the
Poetry virtual environment with:
If you only need to run a single command, use:
poetry run <your-command>
Now you are free to start developing!
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.
Once you are done with Installing Manim using Poetry, you can run the code formatter
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, by the
black command with
python3 -m pip install .
Please see contributing for more details about contributing to Manim. Since pip doesn’t implement editable installations from our pyproject.toml