krassowski / jupyter-manim

manim cell magic for IPython/Jupyter to show the output video
MIT License
194 stars 11 forks source link

UsageError: Line magic function `%%manim` not found. #34

Open Tho100 opened 2 years ago

Tho100 commented 2 years ago

I completed the installation:

pip.exe install manimlib pip.exe install jupyter_manim

when I executed this code:

from manimlib.imports import *
import jupyter_manim
%%manim Shapes

class Shapes(Scene):

    def construct(self):
        circle = Circle()
        self.play(ShowCreation(circle))

The jupyter console displays this error: UsageError: Line magic function %%manim not found.

How do I fix it?

Windows 10

Visual Studio Code

Python 3.9

krassowski commented 2 years ago

%%manim needs to be placed as a first line of a cell. The error message you get suggests that you placed it as n-th line in the cell.

Tho100 commented 2 years ago

I followed your solution:

%%manim Shapes
from manimlib.imports import *
import jupyter_manim

class Shapes(Scene):

    def construct(self):
        circle = Circle()
        self.play(ShowCreation(circle))

The same problem still occurs, I'm not sure if this is the problem with my code syntax or not but I thinks there's something missing I need to install, can you provide list of items I need to install?

BurkovBA commented 2 years ago
Screenshot 2022-07-08 at 19 17 16

Ran into the same issue, using the following configuration:

MacOS 12.1 Python 3.9.2 manimlib 0.2.0 jupyter-manim 1.3

$ pip freeze
anyio @ file:///Users/runner/miniforge3/conda-bld/anyio_1624539456922/work/dist
appnope @ file:///Users/runner/miniforge3/conda-bld/appnope_1610094662606/work
argon2-cffi @ file:///Users/runner/miniforge3/conda-bld/argon2-cffi_1605217032873/work
async-generator==1.10
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1620387926260/work
Babel @ file:///home/conda/feedstock_root/build_artifacts/babel_1619719576210/work
backcall @ file:///home/conda/feedstock_root/build_artifacts/backcall_1592338393461/work
backports.functools-lru-cache @ file:///home/conda/feedstock_root/build_artifacts/backports.functools_lru_cache_1618230623929/work
bleach @ file:///home/conda/feedstock_root/build_artifacts/bleach_1612213472466/work
brotlipy==0.7.0
certifi==2021.10.8
cffi @ file:///Users/runner/miniforge3/conda-bld/cffi_1613413910603/work
chardet @ file:///Users/runner/miniforge3/conda-bld/chardet_1610093454858/work
colour==0.1.5
conda==4.10.3
conda-package-handling @ file:///Users/runner/miniforge3/conda-bld/conda-package-handling_1602876806364/work
cryptography @ file:///Users/runner/miniforge3/conda-bld/cryptography_1612993750122/work
cycler==0.10.0
debugpy @ file:///Users/runner/miniforge3/conda-bld/debugpy_1620178620272/work
decorator @ file:///home/conda/feedstock_root/build_artifacts/decorator_1621187651333/work
defusedxml @ file:///home/conda/feedstock_root/build_artifacts/defusedxml_1615232257335/work
entrypoints @ file:///home/conda/feedstock_root/build_artifacts/entrypoints_1605121927639/work/dist/entrypoints-0.3-py2.py3-none-any.whl
et-xmlfile==1.0.1
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1593328102638/work
importlib-metadata @ file:///Users/runner/miniforge3/conda-bld/importlib-metadata_1624799454352/work
ipykernel @ file:///Users/runner/miniforge3/conda-bld/ipykernel_1625104291016/work/dist/ipykernel-6.0.0-py3-none-any.whl
ipython @ file:///Users/runner/miniforge3/conda-bld/ipython_1625027276352/work
ipython-genutils==0.2.0
jedi @ file:///Users/runner/miniforge3/conda-bld/jedi_1610146802570/work
Jinja2 @ file:///home/conda/feedstock_root/build_artifacts/jinja2_1621419064915/work
joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1633637554808/work
json5 @ file:///home/conda/feedstock_root/build_artifacts/json5_1600692310011/work
jsonschema @ file:///home/conda/feedstock_root/build_artifacts/jsonschema_1614815863336/work
jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1615693636836/work
jupyter-core @ file:///Users/runner/miniforge3/conda-bld/jupyter_core_1612125274649/work
jupyter-manim==1.3
jupyter-server @ file:///home/conda/feedstock_root/build_artifacts/jupyter_server_1624558637735/work
jupyterlab @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_1621368934875/work
jupyterlab-pygments @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_pygments_1601375948261/work
jupyterlab-server @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_server_1622556871679/work
kiwisolver==1.3.2
manimlib==0.2.0
MarkupSafe @ file:///Users/runner/miniforge3/conda-bld/markupsafe_1621455750847/work
matplotlib==3.4.3
matplotlib-inline @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-inline_1618935594181/work
mistune @ file:///Users/runner/miniforge3/conda-bld/mistune_1624941595202/work
nbclassic @ file:///home/conda/feedstock_root/build_artifacts/nbclassic_1621947328608/work
nbclient @ file:///home/conda/feedstock_root/build_artifacts/nbclient_1614336084111/work
nbconvert @ file:///Users/runner/miniforge3/conda-bld/nbconvert_1624472693960/work
nbformat @ file:///home/conda/feedstock_root/build_artifacts/nbformat_1617383142101/work
nest-asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1617163391303/work
notebook @ file:///home/conda/feedstock_root/build_artifacts/notebook_1621259862661/work
numpy @ file:///Users/runner/miniforge3/conda-bld/numpy_1624399908429/work
opencv-python==4.6.0.66
openpyxl @ file:///home/conda/feedstock_root/build_artifacts/openpyxl_1632332968451/work
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1612459636436/work
pandas==1.3.3
pandocfilters==1.4.2
parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1617148930513/work
pexpect @ file:///home/conda/feedstock_root/build_artifacts/pexpect_1602535608087/work
pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1602536217715/work
Pillow==8.3.1
progressbar==2.5
prometheus-client @ file:///home/conda/feedstock_root/build_artifacts/prometheus_client_1622586138406/work
prompt-toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1623977816122/work
psycopg2-binary==2.9.1
ptyprocess @ file:///home/conda/feedstock_root/build_artifacts/ptyprocess_1609419310487/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
pycairo==1.21.0
pycosat @ file:///Users/runner/miniforge3/conda-bld/pycosat_1610094841871/work
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1593275161868/work
pydub==0.25.1
Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1620245170812/work
pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1608055815057/work
pyparsing==2.4.7
pyrsistent @ file:///Users/runner/miniforge3/conda-bld/pyrsistent_1624984668772/work
PySocks @ file:///Users/runner/miniforge3/conda-bld/pysocks_1610291460269/work
python-dateutil==2.8.1
pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1612179539967/work
pyzmq @ file:///Users/runner/miniforge3/conda-bld/pyzmq_1622038487673/work
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1608156231189/work
requests-unixsocket==0.2.0
ruamel-yaml-conda @ file:///Users/runner/miniforge3/conda-bld/ruamel_yaml_1611943386799/work
scikit-learn @ file:///Users/runner/miniforge3/conda-bld/scikit-learn_1635241015035/work
scipy @ file:///Users/runner/miniforge3/conda-bld/scipy_1624824941870/work
Send2Trash @ file:///home/conda/feedstock_root/build_artifacts/send2trash_1624366715919/work
six @ file:///home/conda/feedstock_root/build_artifacts/six_1590081179328/work
sniffio @ file:///Users/runner/miniforge3/conda-bld/sniffio_1610318406004/work
SQLAlchemy==1.4.23
terminado @ file:///Users/runner/miniforge3/conda-bld/terminado_1623365368825/work
testpath @ file:///home/conda/feedstock_root/build_artifacts/testpath_1621261527237/work
threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1633102299089/work
tornado @ file:///Users/runner/miniforge3/conda-bld/tornado_1610094701146/work
tqdm @ file:///home/conda/feedstock_root/build_artifacts/tqdm_1613628259277/work
traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1602771532708/work
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1611695416663/work
wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1600965781394/work
webencodings==0.5.1
websocket-client @ file:///Users/runner/miniforge3/conda-bld/websocket-client_1610127751547/work
xgboost==1.5.0
zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1614945704755/work
Tho100 commented 2 years ago

Is this a list of items I need to install in order to fix the error or you're pointing out you have the same problem occurred?

BurkovBA commented 2 years ago

Sorry about non-descriptive post, @Tho100.

I mean, I ran into the same problem and listed my configuration for reproducibility purposes.

thorwhalen commented 1 year ago

Same here. On Macbook Pro, MacOS Monterey -- version 12.5.1.

image
...$ pip show jupyter-manim
Name: jupyter-manim
Version: 1.3
Summary: Cell magic rendering displaying videos in Jupyter/IPython
Home-page: https://github.com/krassowski/jupyter-manim
Author: Michal Krassowski
Author-email: krassowski.michal+pypi@gmail.com
License: MIT
Location: /Users/thorwhalen/.pyenv/versions/3.10.8/lib/python3.10/site-packages
Requires: IPython, manimlib
Required-by:
xxcc197 commented 1 month ago

just use %manim comment image

xxcc197 commented 1 month ago

even dont't need the import jupyter_manim @Tho100 :)