pygobject / pycairo

Python bindings for cairo
https://pycairo.readthedocs.io
Other
620 stars 85 forks source link

Install fails with python3.12 #352

Open dagraham opened 9 months ago

dagraham commented 9 months ago

Mon 10:37 ~/.config/nvim % pip3.12 install -U pycairo Collecting pycairo Using cached pycairo-1.25.1.tar.gz (347 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pycairo 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 ╰─> [15 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-universal2-cpython-312 creating build/lib.macosx-10.9-universal2-cpython-312/cairo copying cairo/init.py -> build/lib.macosx-10.9-universal2-cpython-312/cairo copying cairo/init.pyi -> build/lib.macosx-10.9-universal2-cpython-312/cairo copying cairo/py.typed -> build/lib.macosx-10.9-universal2-cpython-312/cairo running build_ext Package cairo was not found in the pkg-config search path. Perhaps you should add the directory containing `cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1. [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 pycairo ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

YpeZ commented 9 months ago

I stumbled upon the exact same errors. I solved it on my Ubuntu machine by installing the packages listed here: https://pycairo.readthedocs.io/en/latest/getting_started.html