PyGobjectのインストールエラー

Preview版beta Windows11のWSL2でcudfを使いたくいろいろ模索中に出会った。

$ sudo pip3 install PyGobject
Requirement already satisfied: PyGobject in /usr/lib/python3/dist-packages (3.36.0)
Collecting pycairo>=1.11.1
Using cached pycairo-1.20.1.tar.gz (344 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: pycairo
Building wheel for pycairo (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmp4nji61zf build_wheel /tmp/tmp8ypxuv9m
cwd: /tmp/pip-install-wuub2z1y/pycairo
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
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly


上のような感じでエラーがでたら

sudo apt install libcairo2-dev

してから再度インストールで治った。

この記事が気に入ったらサポートをしてみませんか?