mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Merge pull request #516 from JohnAZoidberg/setup-py
Make manim installable using setuptools (setup.py)
This commit is contained in:
commit
c579c7d99f
3 changed files with 45 additions and 7 deletions
23
README.md
23
README.md
|
@ -5,19 +5,32 @@
|
||||||
Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as seen in the videos at [3Blue1Brown](https://www.3blue1brown.com/).
|
Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as seen in the videos at [3Blue1Brown](https://www.3blue1brown.com/).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Manim runs on python 3.7. You can install the python requirements with
|
Manim runs on python 3.7. You can install the Python requirements with
|
||||||
`python3 -m pip install -r requirements.txt`. System requirements are
|
`python3 -m pip install -r requirements.txt`. System requirements are
|
||||||
[cairo](https://www.cairographics.org), [latex](https://www.latex-project.org),
|
[cairo](https://www.cairographics.org), [ffmpeg](https://www.ffmpeg.org), [sox](http://sox.sourceforge.net), [latex](https://www.latex-project.org) (optional, if you want to use LaTeX).
|
||||||
[ffmpeg](https://www.ffmpeg.org), and [sox](http://sox.sourceforge.net).
|
|
||||||
|
|
||||||
### Directly
|
### Directly
|
||||||
|
Clone this repository and in that directory execute:
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/3b1b/manim.git
|
# Install python requirements
|
||||||
cd manim
|
|
||||||
python3 -m pip install -r requirements.txt
|
python3 -m pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Try it out
|
||||||
python3 -m manim example_scenes.py SquareToCircle -pl
|
python3 -m manim example_scenes.py SquareToCircle -pl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Installing into your system
|
||||||
|
For the previous "direct" method you always have to have this git repository. alternatively you can install it permanently in your system and run it on your own scene files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Inside repository - Install manim (also installs Python requirements)
|
||||||
|
python3 -m pip install .
|
||||||
|
|
||||||
|
# Now you don't need the repository anymore and can run it in other directories
|
||||||
|
cd anywhere
|
||||||
|
manim.py example_scenes.py SquareToCircle -pl
|
||||||
|
```
|
||||||
|
|
||||||
### Directly (Windows)
|
### Directly (Windows)
|
||||||
1. [Install FFmpeg](https://www.wikihow.com/Install-FFmpeg-on-Windows).
|
1. [Install FFmpeg](https://www.wikihow.com/Install-FFmpeg-on-Windows).
|
||||||
2. Install Cairo. Download the wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo. For most users, ``pycairo‑1.18.0‑cp37‑cp37m‑win32.whl`` will do fine.
|
2. Install Cairo. Download the wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo. For most users, ``pycairo‑1.18.0‑cp37‑cp37m‑win32.whl`` will do fine.
|
||||||
|
|
|
@ -14,7 +14,7 @@ else:
|
||||||
"Dropbox (3Blue1Brown)/3Blue1Brown Team Folder"
|
"Dropbox (3Blue1Brown)/3Blue1Brown Team Folder"
|
||||||
)
|
)
|
||||||
if not os.path.isdir(MEDIA_DIR):
|
if not os.path.isdir(MEDIA_DIR):
|
||||||
MEDIA_DIR = "media"
|
MEDIA_DIR = "./media"
|
||||||
print(
|
print(
|
||||||
f"Media will be stored in {MEDIA_DIR + os.sep}. You can change "
|
f"Media will be stored in {MEDIA_DIR + os.sep}. You can change "
|
||||||
"this behavior by writing a different directory to media_dir.txt."
|
"this behavior by writing a different directory to media_dir.txt."
|
||||||
|
@ -26,7 +26,7 @@ SVG_IMAGE_DIR = os.path.join(MEDIA_DIR, "designs", "svg_images")
|
||||||
SOUND_DIR = os.path.join(MEDIA_DIR, "designs", "sounds")
|
SOUND_DIR = os.path.join(MEDIA_DIR, "designs", "sounds")
|
||||||
###
|
###
|
||||||
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
|
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||||
FILE_DIR = os.path.join(os.getenv("FILE_DIR", default=THIS_DIR), "files")
|
FILE_DIR = os.path.join(os.getenv("FILE_DIR", default="."), "files")
|
||||||
TEX_DIR = os.path.join(FILE_DIR, "Tex")
|
TEX_DIR = os.path.join(FILE_DIR, "Tex")
|
||||||
# These two may be depricated now.
|
# These two may be depricated now.
|
||||||
MOBJECT_DIR = os.path.join(FILE_DIR, "mobjects")
|
MOBJECT_DIR = os.path.join(FILE_DIR, "mobjects")
|
||||||
|
|
25
setup.py
Normal file
25
setup.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
from setuptools import setup, find_namespace_packages
|
||||||
|
|
||||||
|
|
||||||
|
setup(name='manim',
|
||||||
|
version='0.1.0',
|
||||||
|
description='Animation engine for explanatory math videos',
|
||||||
|
author='Grant Sanderson',
|
||||||
|
author_email='grant@3blue1brown.com',
|
||||||
|
url='https://github.com/3b1b/manim',
|
||||||
|
license='MIT',
|
||||||
|
packages=find_namespace_packages(),
|
||||||
|
install_requires=[
|
||||||
|
'colour',
|
||||||
|
'numpy',
|
||||||
|
'Pillow',
|
||||||
|
'progressbar',
|
||||||
|
'scipy',
|
||||||
|
'tqdm',
|
||||||
|
'opencv-python',
|
||||||
|
'pycairo',
|
||||||
|
'pydub',
|
||||||
|
],
|
||||||
|
scripts=['manim.py', 'stage_scenes.py', 'big_ol_pile_of_manim_imports.py'],
|
||||||
|
package_data={'manimlib': ['*.tex', 'files/**']},
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue