30

Error while installing manimce, I have been trying to install manimce library on windows subsystem for linux and after running

pip install manimce
Collecting manimce
  Downloading manimce-0.1.1.post2-py3-none-any.whl (249 kB)
     |████████████████████████████████| 249 kB 257 kB/s
Collecting Pillow
  Using cached Pillow-8.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting scipy
  Using cached scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
Collecting colour
  Using cached colour-0.1.5-py2.py3-none-any.whl (23 kB)
Collecting pangocairocffi<0.5.0,>=0.4.0
  Downloading pangocairocffi-0.4.0.tar.gz (17 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy
  Using cached numpy-1.21.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Collecting pydub
  Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting pygments
  Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting cairocffi<2.0.0,>=1.1.0
  Downloading cairocffi-1.3.0.tar.gz (88 kB)
     |████████████████████████████████| 88 kB 160 kB/s
  Preparing metadata (setup.py) ... done
Collecting tqdm
  Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Collecting pangocffi<0.9.0,>=0.8.0
  Downloading pangocffi-0.8.0.tar.gz (33 kB)
  Preparing metadata (setup.py) ... done
Collecting pycairo<2.0,>=1.19
  Using cached pycairo-1.20.1.tar.gz (344 kB)

  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting progressbar
  Downloading progressbar-2.5.tar.gz (10 kB)
  Preparing metadata (setup.py) ... done
Collecting rich<7.0,>=6.0
  Using cached rich-6.2.0-py3-none-any.whl (150 kB)
Collecting cffi>=1.1.0
  Using cached cffi-1.15.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
Collecting commonmark<0.10.0,>=0.9.0
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting typing-extensions<4.0.0,>=3.7.4
  Using cached typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting colorama<0.5.0,>=0.4.0
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: cairocffi, pangocairocffi, pangocffi, pycairo, progressbar
  Building wheel for cairocffi (setup.py) ... done
  Created wheel for cairocffi: filename=cairocffi-1.3.0-py3-none-any.whl size=89650 sha256=afc73218cc9fa1d844d7165f598e2be0428598166b4c3ed9de5bbdc94a0a6977
  Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/f3/97/83/8022b9237866102e18d1b7ac0a269769e6fccba0f63dceb9b7
  Building wheel for pangocairocffi (setup.py) ... done
  Created wheel for pangocairocffi: filename=pangocairocffi-0.4.0-py3-none-any.whl size=19283 sha256=54399796259c6e24f9ab56c5747ab273dcf97fb6fed3e7b54935f9ac49351d50
  Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/60/58/92/507a12a5044f7fcda6f4dfd8e0a607cc1fe957bc0dea885906
  Building wheel for pangocffi (setup.py) ... done
  Created wheel for pangocffi: filename=pangocffi-0.8.0-py3-none-any.whl size=37899 sha256=bea348af93696816b046dd901aa60d29a464460c5faac67628eb7e1ea7d1807d
  Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/c4/df/6d/e9d0f79b1545f6e902cc22773b1429de7a5efc240b891ee009
  Building wheel for pycairo (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/yusifer_zendric/manim_ce/venv/bin/python /home/yusifer_zendric/manim_ce/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpuguwzu3u
       cwd: /tmp/pip-install-l4hqdegr/pycairo_f4d80b8f3e4840a3802342825adcdff5
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
  running build_ext
  'pkg-config' not found.
  Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
  Building wheel for progressbar (setup.py) ... done
  Created wheel for progressbar: filename=progressbar-2.5-py3-none-any.whl size=12074 sha256=7290ef8de5dd955bf756b90130f400dd19c2cc9ea050a5a1dce2803440f581e2
  Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/2c/67/ed/d84123843c937d7e7f5ba88a270d11036473144143355e2747
Successfully built cairocffi pangocairocffi pangocffi progressbar
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ pip install manim_ce
ERROR: Could not find a version that satisfies the requirement manim_ce (from versions: none)
ERROR: No matching distribution found for manim_ce
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ manim example_scenes/basic.py -pql

Command 'manim' not found, did you mean:

  command 'maim' from deb maim (5.5.3-1build1)

Try: sudo apt install <deb name>

(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ sudo apt-get install manim
[sudo] password for yusifer_zendric:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package manim
(venv) yusifer_zendric@Laptop-Yusifer:~/manim_ce$ pip3 install manimlib
Collecting manimlib
  Downloading manimlib-0.2.0.tar.gz (4.8 MB)
     |████████████████████████████████| 4.8 MB 498 kB/s
  Preparing metadata (setup.py) ... done
Collecting Pillow
  Using cached Pillow-8.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting argparse
  Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting colour
  Using cached colour-0.1.5-py2.py3-none-any.whl (23 kB)
Collecting numpy
  Using cached numpy-1.21.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Collecting opencv-python
  Downloading opencv_python-4.5.4.60-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.3 MB)
     |████████████████████████████████| 60.3 MB 520 kB/s
Collecting progressbar
  Using cached progressbar-2.5-py3-none-any.whl
Collecting pycairo
  Using cached pycairo-1.20.1.tar.gz (344 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pydub
  Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting pygments
  Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting scipy
  Using cached scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (39.3 MB)
Collecting tqdm
  Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Building wheels for collected packages: manimlib, pycairo
  Building wheel for manimlib (setup.py) ... done
  Created wheel for manimlib: filename=manimlib-0.2.0-py3-none-any.whl size=212737 sha256=27efe2c226d80cfe5663928e980d3e5f5a164d8e9d0aacea5014d37ffdedb76a
  Stored in directory: /home/yusifer_zendric/.cache/pip/wheels/87/36/c1/2db5ed5de9908034108f3c39538cd3367445d9cec01e7c8c23
  Building wheel for pycairo (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/yusifer_zendric/manim_ce/venv/bin/python /home/yusifer_zendric/manim_ce/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp5o2970su
       cwd: /tmp/pip-install-sxxp3lw2/pycairo_d372a62d0c6b4c4484391402d21485e1
  Complete output (12 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.py -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/__init__.pyi -> build/lib.linux-x86_64-3.8/cairo
  copying cairo/py.typed -> build/lib.linux-x86_64-3.8/cairo
  running build_ext
  'pkg-config' not found.
  Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
Successfully built manimlib
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

all the libraries are installed accept the pycairo library. It's just showing this to install pyproject.toml error. Infact I have already done pip install pyproject.toml and it is installed then also it's showing the same error.

Yusifer Zendric
  • 404
  • 1
  • 3
  • 7
  • Does this answer your question? https://stackoverflow.com/questions/8704407/how-do-you-install-pycairo-cairo-for-python-on-windows | And here are the wheels by the way: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo – CozyCode Dec 28 '21 at 15:05
  • I have downloaded the whl from there and tried to do the installation, but it failed on downloading wheel with the same error – Yusifer Zendric Dec 28 '21 at 15:19
  • I have the same error while installing ```pycairo``` itself... – KarlsMaranjs Jan 24 '22 at 01:36

11 Answers11

20
apt-get install sox ffmpeg libcairo2 libcairo2-dev
apt-get install texlive-full
pip3 install manimlib  # or pip install manimlib

Then:

pip3 install manimce  # or pip install manimce

And everything works.

Yevgeniy Kosmak
  • 3,561
  • 2
  • 10
  • 26
  • 6
    I don't think texlive-full has *anything* to do with pycairo, it's just a latex package: https://installati.one/ubuntu/20.04/texlive-full/; also, ffmpeg is something related to audio/video: https://ffmpeg.org/; pycairo only requires libcairo2 and libcairo2-dev to be insalled: apt-get install libcairo2 libcairo2-dev will do the trick – Hello Lili Sep 18 '22 at 11:39
  • "manimce" package is deprecated (see, https://pypi.org/project/manimce/#description); use manim instead. – phenomenon Apr 13 '23 at 10:13
12

You can do simply

sudo apt install libcairo2-dev pkg-config python3-dev

Then

pip3 install pycairo
pH4nT0M
  • 175
  • 2
  • 10
10

I had the same error, for a different package however. I solved the issue with:

apt install libpython3.9-dev
pdaawr
  • 436
  • 7
  • 16
6

The same issue occurred on trying to install reportlab.

A crucial hint in the error message is 'pkg-config' not found.

On MacOS consider this:

  1. Install Homebrew (by following the instructions on https://brew.sh)

  2. Then:

brew install cairo
brew install pkg-config
pip install pycairo

After that, pip install reportlab worked without a hitch.

4

In my case I'm trying to install PyGObject in Fedora.
But I experience the same problem.
Here's how to do it in Fedora.

sudo dnf install gobject-introspection-devel cairo-gobject-devel

follow by installing the lib that you're using, in my case was PyGObject

pip install PyGObject
Zen3515
  • 309
  • 4
  • 12
4

This worked for me

  • Ubuntu/Debian: sudo apt install libcairo2-dev pkg-config python3-dev
  • macOS/Homebrew: brew install cairo pkg-config
  • Arch Linux: sudo pacman -S cairo pkgconf
  • Fedora: sudo dnf install cairo-devel pkg-config python3-devel
  • openSUSE: sudo zypper install cairo-devel pkg-config python3-devel

Source

cconsta1
  • 737
  • 1
  • 6
  • 20
Matt M
  • 41
  • 1
  • I ended up having this issue on Mac and it was apparently related to a `brew` issue. I was able to resolve it by following [this comment](https://github.com/mesonbuild/meson/issues/2273#issuecomment-420412230) which suggested doing `brew reinstall libffi` and then `export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"` – travisw May 09 '23 at 18:08
  • this worked for me, tnx – Almedin Hodžić May 30 '23 at 19:22
3

These two commands worked for me

sudo apt-get install sox ffmpeg libcairo2 libcairo2-dev

sudo apt install libgirepository1.0-dev
Manish Saini
  • 101
  • 1
  • 6
1

I had the exact description of the error but for different module (aiohttp). Just in case will leave here the description of encountered error and the solution.

The error below I got while executing pip install -r requirements.txt for installation I made:

socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"                                   
          ^~~~~~~                        1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang' 
failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects

This error is specific to Python 3.11 version. On Python with 3.10.6 version installation went fine.

To solve it I needed to update requirements.txt.

Not working versions of modules with Python 3.11:

aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0

Working versions:

aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1

Links to the corresponding issues with fixes:

Anton Samokat
  • 542
  • 1
  • 6
  • 15
0

Make sure to have the right versions of pip and setuptools

pip install --upgrade pip setuptools wheel
Ishan Anand
  • 119
  • 1
  • 7
0

First, install conda install -c conda-forge cxx-compiler And then try running pip install llama-cpp-python==0.1.48 It worked for me. As it will pick c++ compiler from conda instead of root machine. So, without changing compiler version you will able to install lamma

-2

step 1: try: pip install wheel step 2: pip install manimce

if still doesn't work try: pip3 instead of pip

else: reinstall python and follow steps 1 and step 2

and if it still doesn't work install a lower version and if it still doesn't work make sure it is the right package and if it still doesn't work there is some fatal error somewhere