You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But during install, it is failing to find "cairo".
Compiler for C supports arguments -Wswitch-default: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Found pkg-config: YES (/opt/local/bin/pkg-config) 0.29.2
Found CMake: /Users/chillaranand/homebrew/bin/cmake (3.30.3)
Run-time dependency cairo found: NO (tried pkgconfig, framework and cmake)
../cairo/meson.build:31:12: ERROR: Dependency "cairo" not found, tried pkgconfig, framework and cmake
A full log can be found at /private/var/folders/vb/3wyl_42s4x1_z_7swgpq9xr40000gq/T/pip-install-dr_abefi/pycairo_8e2c36b9f63e490084503233417555c7/.mesonpy-joompwi1/meson-logs/meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
The text was updated successfully, but these errors were encountered:
Just found a fix for the same issue occurring with macOS 15.1.1, on a clean Python 3.12.7 miniconda environment.
Based on this comment I managed to defined a proper PKG_CONFIG_PATH that solved the issue. The process is a bit cumbersome though so a more long term solution is still needed.
Here s a quick run down of the procedure I had to go through for some libraries (cairo, fontconfig, freetype2, x11 and xcb in my case):
Check the location of a missing library by running find /opt -name <library name>.pc in the terminal.
eg. find /opt -name cairo.pc gave me: /opt/homebrew/Cellar/cairo/1.18.2/lib/pkgconfig/cairo.pc
If the library is not installed on your system, no paths will be returned by the command. Install the package using brew install <library name> and try again.
Add the library path to PKG_CONFIG_PATH export PKG_CONFIG_PATH="<parent directory path of the missing lib>:$PKG_CONFIG_PATH"
eg. export PKG_CONFIG_PATH="/opt/homebrew/Cellar/cairo/1.18.2/lib/pkgconfig/:$PKG_CONFIG_PATH"
In the same terminal session check that pkg-config finds the library by running pkg-config --libs <lib name>
eg. pkg-config --libs cairo
Try installing pycairo (pip install pycairo), if the errors pops back up with a different package, repeat the process and append the new package path to PKG_CONFIG_PATH.
For reference, by the time I managed to get pycairo installed, my PKG_CONFIG_PATH looked like this:
I have already installed the pre-requisites.
But during install, it is failing to find "cairo".
The text was updated successfully, but these errors were encountered: