Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (of new feature): JupyterLab docker image and documentation for manim and IPython #977

Merged
merged 8 commits into from
Jan 31, 2021
6 changes: 6 additions & 0 deletions docker/Dockerfile.jupyter
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM manimcommunity/manim:latest

RUN pip install jupyterlab

EXPOSE 8888
CMD [ "jupyter", "lab", "--allow-root", "--ip=0.0.0.0" ]
9 changes: 9 additions & 0 deletions docker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ Then, to render a scene `CircleToSquare` in a file `test_scenes.py`, call
$ docker exec -it --user="$(id -u):$(id -g)" my-manim-container manim test.py CircleToSquare -qm
```

## Jupyterlab
Another alternative is to use the `manimcommunity/manim:jupyterlab` image, which spins up a local webserver running
JupyterLab in whose Python kernel manim is installed and can be accessed via the `%%manim` cell magic. To use this container,
run
```
$ docker run -it -p 8888:88888 manimcommunity/manim:jupyterlab
```
and then follow the instructions in the terminal.

kolibril13 marked this conversation as resolved.
Show resolved Hide resolved
# Important notes
When executing `manim` within a Docker container, several command line flags (in particular `-p` (preview file) and `-f` (show output file in the file browser)) are not supported.

Expand Down
15 changes: 8 additions & 7 deletions manim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

__version__ = importlib_metadata.version(__name__)


# Importing the config module should be the first thing we do, since other
# modules depend on the global config dict for initialization.
from ._config import *
Expand Down Expand Up @@ -100,10 +108,3 @@
ipy.register_magics(ManimMagic)

from .plugins import *

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

__version__ = importlib_metadata.version(__name__)