Manim: [BUG-General] ModuleNotFoundError with clean installation

Created on 29 Oct 2020  Â·  4Comments  Â·  Source: ManimCommunity/manim

Describe the bug

Fresh installation of manim is not working due to a ModuleNotFoundError (although pangocairocffi is installed):

(manim) ➜ manim scene.py SquareToCircle -q p
Traceback (most recent call last):
  File "/home/ackxolotl/.virtualenvs/manim-AwzoOjs3/bin/manim", line 5, in <module>
    from manim.__main__ import main
  File "/home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages/manim/__init__.py", line 47, in <module>
    from .mobject.svg.text_mobject import *
  File "/home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages/manim/mobject/svg/text_mobject.py", line 13, in <module>
    import pangocairocffi
  File "/home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages/pangocairocffi/__init__.py", line 11, in <module>
    from ._generated.ffi import ffi
ModuleNotFoundError: No module named 'pangocairocffi._generated.ffi'

To Reproduce

Do a clean installation on latest Arch Linux, Python 3.8. I installed manimce with pipenv.

Problematic Code

pipenv install manimce

tee scene.py << EOF
from manim import *
class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()                   # create a circle
        circle.set_fill(PINK, opacity=0.5)  # set the color and transparency
        self.play(ShowCreation(circle))     # show the circle on screen
EOF

manim scene.py SquareToCircle -q p

Expected behavior

I expected to get the rendered tutorial video.

System Specifications

System Details

  • OS: 5.9.1-arch1-1
  • RAM: 16 GB
  • Python version (python/py/python3 --version): 3.8.6
  • Installed modules (provide output from pip list):
Package           Version
----------------- -------
cairocffi         1.1.0
cffi              1.14.3
colorama          0.4.4
colour            0.1.5
commonmark        0.9.1
grpcio            1.33.2
grpcio-tools      1.33.2
manimce           0.1.0
numpy             1.19.3
pangocairocffi    0.3.2
pangocffi         0.6.0
pathtools         0.1.2
Pillow            8.0.1
pip               20.2.3
progressbar       2.5
protobuf          3.13.0
pycairo           1.20.0
pycparser         2.20
pydub             0.24.1
Pygments          2.7.2
rich              9.1.0
scipy             1.5.3
setuptools        50.3.0
six               1.15.0
tqdm              4.51.0
typing-extensions 3.7.4.3
watchdog          0.10.3
wheel             0.35.1

FFMPEG
Output of ffmpeg -version:

ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.1.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

bug

Most helpful comment

Thanks for your report! There seems to be an unfortunate problem with the installation of pangocairocffi where the generation of the ffi bindings does not happen automatically.

You can solve it locally by changing to your site-packages directory, /home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages and then, within your virtualenv, running python pangocairocffi/ffi_build.py. This should build the required bindings in the pangocairocffi/_generated directory.

Another option is to reinstall pangocairocffi using pip install --no-binary :all: -U pangocairocffi.

Could you please try whether either of these suggestions solves your problem?

All 4 comments

Thanks for your report! There seems to be an unfortunate problem with the installation of pangocairocffi where the generation of the ffi bindings does not happen automatically.

You can solve it locally by changing to your site-packages directory, /home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages and then, within your virtualenv, running python pangocairocffi/ffi_build.py. This should build the required bindings in the pangocairocffi/_generated directory.

Another option is to reinstall pangocairocffi using pip install --no-binary :all: -U pangocairocffi.

Could you please try whether either of these suggestions solves your problem?

You can solve it locally by changing to your site-packages directory, /home/ackxolotl/.virtualenvs/manim-AwzoOjs3/lib/python3.8/site-packages and then, within your virtualenv, running python pangocairocffi/ffi_build.py. This should build the required bindings in the pangocairocffi/_generated directory.

That fixed it! Thanks a lot

Good catch @behackl

Can I ask either of you two to add this experience to our troubleshooting page? That would be a huge help for those who come after us :) https://docs.manim.community/en/latest/installation/troubleshooting.html

I've prepared a PR: #633.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XorUnison picture XorUnison  Â·  6Comments

huguesdevimeux picture huguesdevimeux  Â·  5Comments

leotrs picture leotrs  Â·  5Comments

huguesdevimeux picture huguesdevimeux  Â·  7Comments

naveen521kk picture naveen521kk  Â·  4Comments