The issue is quite simple. I've installed Python and Cairo with Homebrew since I use a M1 MacBook. When trying to import the package, I get this error:
>>> import cairo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cairo/_cairo.cpython-39-darwin.so, 2): Symbol not found: _cairo_append_path
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cairo/_cairo.cpython-39-darwin.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cairo/_cairo.cpython-39-darwin.so
Thank you in advance.