ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
26.48k stars 1.82k forks source link

Manim render command leads to "cannot import name 'DEFAULT_DASH_LENGTH' from 'manim.mobject.geometry'" error #3910

Closed mustafabugraavci closed 3 months ago

mustafabugraavci commented 3 months ago

Description of bug / unexpected behavior

Manim Community v0.18.1

Traceback (most recent call last): File "/home/bugra/.local/bin/codevidgen", line 8, in sys.exit(main()) File "/home/bugra/.local/lib/python3.10/site-packages/code_video_cli/init.py", line 21, in main manim_main() File "/home/bugra/.local/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/bugra/.local/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/bugra/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/bugra/.local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/bugra/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) File "/home/bugra/.local/lib/python3.10/site-packages/manim/cli/render/commands.py", line 116, in render for SceneClass in scene_classes_from_file(file): File "/home/bugra/.local/lib/python3.10/site-packages/manim/utils/module_ops.py", line 131, in scene_classes_from_file module = get_module(file_path) File "/home/bugra/.local/lib/python3.10/site-packages/manim/utils/module_ops.py", line 54, in get_module spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/bugra/flask_app/video.py", line 2, in from code_video import CodeScene File "/home/bugra/.local/lib/python3.10/site-packages/code_video/init.py", line 5, in from .sequence import Actor # noqa File "/home/bugra/.local/lib/python3.10/site-packages/code_video/sequence.py", line 22, in from manim.mobject.geometry import DEFAULT_DASH_LENGTH ImportError: cannot import name 'DEFAULT_DASH_LENGTH' from 'manim.mobject.geometry' (/home/bugra/.local/lib/python3.10/site-packages/manim/mobject/geometry/init.py)

Expected behavior

How to reproduce the issue

manim render video.py

Code for reproducing the problem ```py from manim import * from code_video import CodeScene class MyScene(CodeScene): def construct(self): # This does the actual code display and animation self.animate_code_comments("video.py") # Wait 5 seconds before finishing self.wait(5) ```

Additional media files

Images/GIFs

Logs

Terminal output ``` PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR ```

System specifications

System Details - OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Linux DESKTOP-EEELAJC 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux - RAM: 16GB - Python version (`python/py/python3 --version`): Python 3.10.12 - Installed modules (provide output from `pip list`): ``` Package Version ---------------------------- ------------- annotated-types 0.7.0 ansiwrap 0.8.4 appdirs 1.4.4 argcomplete 1.8.1 astroid 3.2.4 attrs 23.1.0 audioread 3.0.1 beautifulsoup4 4.10.0 beniget 0.4.1 black 22.3.0 blinker 1.8.2 Brotli 1.0.9 cachetools 5.4.0 catkin-pkg-modules 1.0.0 certifi 2023.7.22 cffi 1.17.0 chardet 4.0.0 charset-normalizer 3.2.0 click 8.1.7 cloup 3.0.5 code-video-generator 0.5.0 colorama 0.4.6 command-not-found 0.3 coverage 6.3.2 cryptography 3.4.8 cycler 0.11.0 dbus-python 1.2.18 decorator 4.4.2 dill 0.3.8 distro 1.7.0 distro-info 1.1build1 docutils 0.17.1 dominate 2.9.1 empy 3.3.4 entrypoints 0.4 factory-boy 2.12.0 Faker 26.3.0 fastjsonschema 2.18.0 ffmpeg-python 0.2.0 find-libpython 0.3.0 flake8 4.0.1 Flask 3.0.3 Flask-Bootstrap 3.3.7.1 Flask-Cors 4.0.1 Flask-SQLAlchemy 3.1.1 flask-talisman 1.1.0 Flask-WTF 1.2.1 fonttools 4.29.1 fs 2.4.12 future 1.0.0 gast 0.5.2 glcontext 3.0.0 google-ai-generativelanguage 0.6.6 google-api-core 2.19.1 google-api-python-client 2.140.0 google-auth 2.33.0 google-auth-httplib2 0.2.0 google-generativeai 0.7.2 googleapis-common-protos 1.63.2 greenlet 3.0.3 grpcio 1.65.4 grpcio-status 1.62.3 gunicorn 20.1.0 gyp 0.1 honcho 1.1.0 html5lib 1.1 httplib2 0.20.2 idna 3.4 importlib-metadata 4.6.4 iniconfig 1.1.1 isort 5.13.2 isosurfaces 0.1.2 itsdangerous 2.2.0 jeepney 0.7.1 Jinja2 3.1.4 joblib 1.4.2 jsonschema 4.19.0 jsonschema-specifications 2023.7.1 jupyter_client 8.3.1 jupyter_core 5.3.1 keyring 23.5.0 kiwisolver 1.3.2 lark 1.1.1 launchpadlib 1.10.16 lazr.restfulclient 0.14.4 lazr.uri 1.0.6 lazy_loader 0.4 librosa 0.10.2.post1 llvmlite 0.43.0 lxml 4.8.0 lz4 3.1.3+dfsg manim 0.18.1 ManimPango 0.5.0 mapbox_earcut 1.0.2 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.5.1 mccabe 0.6.1 mdurl 0.1.2 moderngl 5.11.1 moderngl-window 2.4.6 more-itertools 8.10.0 mpi4py 3.1.3 mpmath 0.0.0 msgpack 1.0.8 multipledispatch 1.0.0 mypy-extensions 1.0.0 nbclient 0.8.0 nbformat 5.9.2 netifaces 0.11.0 networkx 3.3 nose 1.3.7 numba 0.60.0 numpy 1.26.4 oauthlib 3.2.0 olefile 0.46 packaging 21.3 papermill 2.4.0 pathspec 0.12.1 pillow 10.4.0 pinocchio 0.4.3 pip 22.0.2 platformdirs 3.10.0 pluggy 0.13.0 ply 3.11 pooch 1.8.2 proto-plus 1.24.0 protobuf 4.25.4 psutil 5.9.0 py 1.10.0 pyasn1 0.6.0 pyasn1_modules 0.4.0 pycairo 1.20.1 pycodestyle 2.8.0 pycparser 2.22 pydantic 2.8.2 pydantic_core 2.20.1 pydocstyle 6.1.1 pydot 1.4.2 pydub 0.25.1 pyflakes 2.4.0 pyglet 2.0.17 Pygments 2.18.0 PyGObject 3.42.1 PyJWT 2.3.0 pylint 3.2.6 pyparsing 2.4.7 PyQt5 5.15.6 PyQt5-sip 12.9.1 pyrr 0.10.3 pytest 6.2.5 python-apt 2.4.0+ubuntu1 python-dateutil 2.8.2 pythran 0.10.0 pytz 2022.1 PyYAML 5.4.1 pyzmq 25.1.1 referencing 0.30.2 requests 2.31.0 rich 13.7.1 roman 3.3 rosdistro-modules 0.9.1 rospkg-modules 1.5.1 rpds-py 0.10.2 rsa 4.9 scikit-learn 1.5.1 scipy 1.14.0 screeninfo 0.8.1 SecretStorage 3.3.1 setuptools 59.6.0 six 1.16.0 skia-pathops 0.8.0.post1 snowballstemmer 2.2.0 soundfile 0.12.1 soupsieve 2.3.1 soxr 0.4.0 SQLAlchemy 2.0.32 srt 3.5.3 svgelements 1.9.6 sympy 1.9 systemd-python 234 tenacity 8.2.3 textwrap3 0.9.2 threadpoolctl 3.5.0 toml 0.10.2 tomli 2.0.1 tomlkit 0.13.0 tornado 6.3.3 tqdm 4.66.1 traitlets 5.9.0 typing_extensions 4.12.2 ubuntu-advantage-tools 8001 ufoLib2 0.13.1 ufw 0.36.1 unattended-upgrades 0.1 unicodedata2 14.0.0 uritemplate 4.1.1 urllib3 2.0.4 visitor 0.1.3 wadllib 1.3.6 watchdog 4.0.2 webencodings 0.5.1 Werkzeug 3.0.3 wheel 0.37.1 wrapt 1.16.0 WTForms 3.1.2 zipp 1.0.0 ```
LaTeX details + LaTeX distribution (e.g. TeX Live 2020): + Installed LaTeX packages:

Additional comments

behackl commented 3 months ago

This is a bug in code-video-generator and will need to be solved in that package, see https://github.com/sleuth-io/code-video-generator/issues/6.