Search code examples
pythonpipmanim

ImportError: DLL load failed while importing mapbox_earcut: The specified module could not be found


I recently installed manim, and tried to run some sample codes. A few days ago, there was no problem at all, but today I faced an error. It may occured because I upgraded my Python version today (3.9 -> 3.11.2).

  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Scripts\manim.exe\__main__.py", line 4, in <module>
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\site-packages\manim\__init__.py", line 24, in <module>
    from .animation.animation import *
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\site-packages\manim\animation\animation.py", line 6, in <module>
    from manim.mobject.opengl.opengl_mobject import OpenGLMobject
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\site-packages\manim\mobject\opengl\opengl_mobject.py", line 17, in <module>
    from manim.utils.bezier import integer_interpolate, interpolate
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\site-packages\manim\utils\bezier.py", line 31, in <module>
    from ..utils.space_ops import cross2d, find_intersection
  File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\site-packages\manim\utils\space_ops.py", line 44, in <module>
    from mapbox_earcut import triangulate_float32 as earcut
ImportError: DLL load failed while importing mapbox_earcut: The specified module could not be found.

I had tried reinstalling the package 'mapbox_earcut' using pip, but it didn't work.

One thing I found interesting was that there was no folder called 'mapbox_earcut' in the pip packages folder.

pip folders


Solution

  • I had the same issue. I fixed it by installing Microsoft Visual C++.

    https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170