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

Installing on MacOS - A Series of Missing Modules #2227

Closed
zhiangseanwang opened this issue Oct 22, 2024 · 9 comments
Closed

Installing on MacOS - A Series of Missing Modules #2227

zhiangseanwang opened this issue Oct 22, 2024 · 9 comments

Comments

@zhiangseanwang
Copy link

I am trying to install ManimGL after watching the latest 3B1B video.
I am on a M3 Macbook Pro.

I ran pip3 install manimgl which worked.

Then I tried the manimgl example_scenes.py OpeningManimExample command which was supposed to render a scene.

Instead an error showed up that read:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/manimgl", line 5, in <module>
    from manimlib.__main__ import main
  File "/Users/Sean/manim/manimlib/__init__.py", line 1, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

I attempted to resolve this by installing setuptools separately, using pip3 install setuptools
Then I ran the same manimgl command again but met another error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/manimgl", line 5, in <module>
    from manimlib.__main__ import main
  File "/Users/Sean/manim/manimlib/__init__.py", line 14, in <module>
    from manimlib.animation.animation import *
  File "/Users/Sean/manim/manimlib/animation/animation.py", line 5, in <module>
    from manimlib.mobject.mobject import _AnimationBuilder
  File "/Users/Sean/manim/manimlib/mobject/mobject.py", line 27, in <module>
    from manimlib.utils.color import color_gradient
  File "/Users/Sean/manim/manimlib/utils/color.py", line 11, in <module>
    from manimlib.utils.bezier import interpolate
  File "/Users/Sean/manim/manimlib/utils/bezier.py", line 9, in <module>
    from manimlib.utils.space_ops import cross2d
  File "/Users/Sean/manim/manimlib/utils/space_ops.py", line 8, in <module>
    from mapbox_earcut import triangulate_float32 as earcut
ModuleNotFoundError: No module named 'mapbox_earcut'

I then tried pip3 install mapbox-earcut but got this:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pydub/utils.py", line 14, in <module>
    import audioop
ModuleNotFoundError: No module named 'audioop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/manimgl", line 5, in <module>
    from manimlib.__main__ import main
  File "/Users/Sean/manim/manimlib/__init__.py", line 60, in <module>
    from manimlib.scene.interactive_scene import *
  File "/Users/Sean/manim/manimlib/scene/interactive_scene.py", line 28, in <module>
    from manimlib.scene.scene import Scene
  File "/Users/Sean/manim/manimlib/scene/scene.py", line 40, in <module>
    from manimlib.scene.scene_file_writer import SceneFileWriter
  File "/Users/Sean/manim/manimlib/scene/scene_file_writer.py", line 10, in <module>
    from pydub import AudioSegment
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pydub/__init__.py", line 1, in <module>
    from .audio_segment import AudioSegment
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pydub/audio_segment.py", line 11, in <module>
    from .utils import mediainfo_json, fsdecode
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pydub/utils.py", line 16, in <module>
    import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'

At this point I can't manually install anything extra, so I am stuck.

Has this issue happened to anyone else? I would really appreciate your help! Thanks in advance.

@mitkonikov
Copy link
Contributor

This is because ManimGL 1.7.0 has not yet been released on PyPI. The version you are downloading through pip, is very old and doesn't support new versions of Python. For now, you can download the repository and install ManimGL from the repository itself by running pip install . in the repository folder. You don't need to fork the repository.

@3b1b It would be great to update the actual PyPI package to version 1.7.0, so people don't have problems downloading ManimGL through PyPI. This will close many issues related to 1.6.1.

@3b1b
Copy link
Owner

3b1b commented Oct 23, 2024

I just updated it on PyPI. Does the newer version work for you?

@zhiangseanwang
Copy link
Author

It works perfectly. Thank you very much!

@mitkonikov
Copy link
Contributor

Do you want me to compile a list of issues that are based on errors when starting the 1.6.1 version of Manim in newer Python environments? Now that the PyPI package has been updated, we can just notify the issue authors and close them. In case someone reopens them, we would be happy to investigate further.

@3b1b
Copy link
Owner

3b1b commented Oct 23, 2024

Sure, that'd be very helpful. Thanks!

@mitkonikov
Copy link
Contributor

I've tested the PyPI release in a sandbox, it works, but there's one dependency that is not in the package list and is not installed by pip when installing manimgl. We have to add mapbox_earcut in the dependencies here. Compare the dependencies with the requirements.txt.

List of issues related to running ManimGL 1.6.1 in newer Python versions

Many libraries, such as numpy are not backwards compatible. So, when running newer versions of Python, pip installs newer packages. Particularly numpy after 1.24 made some changes that broke ManimGL 1.6.1 (when Manim was comparing some set of points, there was a dimensionality mismatch of arrays, this is not allowed anymore in the newer numpy versions. It throws an error). At the same time, numpy<=1.24 cannot be installed on newer Python versions.

@3b1b
Copy link
Owner

3b1b commented Oct 23, 2024

I see, I just added that. What's the simplest way to add that dependency, it feels a little silly to add a whole new release (as you can tell, this is unfamiliar territory for me).

@mitkonikov
Copy link
Contributor

Unfortunately, there's no way to update the PyPI package without releasing a new one. Just bumping the minor version from 1.7.0 to 1.7.1 is totally fine. In fact, this is not silly, more frequent releases are recommended if the API doesn't break. This way we provide the latest bug fixes to newcomers and to old users as well. If you believe that just bumping this dependency is not worth it, I suggest waiting for a few more bug fixes and maybe giving me some time to test a few more critical things that need fixing. I have trouble with the -p command in the master branch. Because I was working with -se, I didn't even notice problems with -p.

@ctxzz
Copy link

ctxzz commented Nov 5, 2024

ModuleNotFoundError: No module named 'pyaudioop'

This worked after installing audioop-lts.

pip install audioop-lts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants