错误:无法为pycairo构建轮子,这是安装基于pyproject.toml的项目所必需的



安装manimce时出错,我一直试图在linux的windows子系统上安装manimce库,并在运行后

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

所有已安装的库都接受pycairo库。它只是显示了安装pyproject.toml错误。事实上,我已经完成了pip-install-pyproject.toml,它已经安装好了,然后它也显示了同样的错误。

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

然后:

pip3 install manimce  # or pip install manimce

一切正常。

您可以简单地进行

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

然后

pip3 install pycairo

我有同样的错误,但对于不同的包。我用解决了这个问题

apt install libpython3.9-dev

在尝试安装reportlab时也出现了同样的问题。

错误消息中的一个重要提示是未找到'kg-config'

在MacOS上考虑一下:

  1. 安装Homebrew(按照https://brew.sh)

  2. 然后:

brew install cairo
brew install pkg-config
pip install pycairo

之后,pip install reportlab工作顺利。

在我的情况下,我正在尝试在Fedora中安装PyGObject
但我遇到了同样的问题
以下是如何在Fedora中执行此操作。

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

接下来安装您正在使用的库,在我的案例中是PyGObject

pip install PyGObject

这对我有效

  • Ubuntu/Debian:sudo apt install libcairo2-dev pkg-config python3-dev
  • macOS/Homebrew:brew install cairo pkg-config
  • 架构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

这两个命令适用于我的

sudo apt-get install sox ffmpeg libcairo2 libcairo2-dev
sudo apt install libgirepository1.0-dev

我有错误的确切描述,但针对不同的模块(aiohttp(。以防万一会在这里留下遇到错误的描述和解决方案。

我在执行pip install -r requirements.txt进行安装时出现以下错误:

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

此错误特定于Python3.11版本。在带有3.10.6版本的Python上,安装进行得很顺利。

为了解决这个问题,我需要更新requirements.txt

使用Python3.11:的模块的不工作版本

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

工作版本:

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

链接到相应的问题与修复:

  • https://github.com/aio-libs/aiohttp/issues/6600
  • https://github.com/aio-libs/yarl/issues/706
  • https://github.com/aio-libs/frozenlist/issues/305

确保拥有正确版本的pip和setuptools

pip install --upgrade pip setuptools wheel

首先,安装conda-install-c conda-forge cxx编译器然后尝试运行pip-install-lama-cpp-python==0.1.48它对我有效。因为它将从conda而不是根计算机中选择c++编译器。因此,在不更改编译器版本的情况下,您将能够安装lamma

步骤1:尝试:pip install wheel步骤2:pip install manimce

如果仍然不起作用,请尝试:pip3而不是pip

否则:重新安装python并执行步骤1和步骤2

如果仍然不起作用,请安装较低版本如果它仍然不起作用,请确保它是正确的包装如果它仍然不起作用,某处就会出现致命错误

相关内容

  • 没有找到相关文章

最新更新