M2Macのvenv上で以下のエラーに遭遇
...
manimpango.c:773:10: fatal error: 'cairo.h' file not found
#include "cairo.h"
^~~~~~~~~
1 error generated.
error: command '/usr/bin/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 manimpango
Building wheel for pycairo (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pycairo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13-arm64-cpython-311
creating build/lib.macosx-13-arm64-cpython-311/cairo
copying cairo/__init__.py -> build/lib.macosx-13-arm64-cpython-311/cairo
copying cairo/__init__.pyi -> build/lib.macosx-13-arm64-cpython-311/cairo
copying cairo/py.typed -> build/lib.macosx-13-arm64-cpython-311/cairo
running build_ext
'pkg-config' not found.
Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycairo
Failed to build manimpango pycairo
ERROR: Could not build wheels for manimpango, pycairo, which is required to install pyproject.toml-based projects
解決法
1.まず以下の公式のRequirementをインストールしたか確認
2.以下のページで言われてることをやったが、解決しなかった。
この間に
brew install Cython
を実行
3.pkg-configをインストール。
最初のエラーをよく見ると 'pkg-config' not found.
とある。
よって
brew install pkg-config
を実行したのちに
pip install manim
を行ったらうまくインストールできた。