cairocffi icon indicating copy to clipboard operation
cairocffi copied to clipboard

It looks like your cairocffi was not built with xcffib support

Open fmipsylone opened this issue 3 years ago • 1 comments

Hello,

Trying to install Qtile window manager on a "RPI 4 buster lite", I got the following error in Qtile build with cairocffi-1.2.0 installed with pip:

It looks like your cairocffi was not built with xcffib support.  To fix this:
  
    - Ensure a recent xcffib is installed (pip install 'xcffib>=0.5.0')
    - The pip cache is cleared (remove ~/.cache/pip, if it exists)
    - Reinstall cairocffi, either:
  
        pip install --no-deps --ignore-installed cairocffi
  
      or
  
        pip uninstall cairocffi && pip install cairocffi
  
  
  ----------------------------------------
  Failed building wheel for qtile

If I uninstall cairocffi installed from pip to use the debian package via:

pip3 uninstall cairocffi
sudo apt install python3-cairocffi

The 0.7.2 cairocffi version is installed on the system and Qtile builds correctly. In my tests the python3-cairocffi package installation did not add any missing dependencies. So it seems all required debian packages dependencies were satisfied before 'cairocffi' install via 'pip'.

Does something changed with xcffib support ? Or is it mandatory to use cairocffi from a distribution package ? Does we need another debian package headers dependencies to build ?

Thanks you guys for your replies

fmipsylone avatar May 21 '21 08:05 fmipsylone

Does something changed with xcffib support ?

CairoCFFI 0.7.2 has been released in 2015, a lot of things changed…

If you want to install CairoCFFI with XCB support, you have to use pip install cairocffi[xcb]. It will install xcffib. That’s probably what’s missing for qtile.

Or is it mandatory to use cairocffi from a distribution package ?

No, it’s not. Installing with pip should just work.

So it seems all required debian packages dependencies were satisfied before 'cairocffi' install via 'pip'.

Maybe a more recent version of xcffib is required with recent versions of CairoCFFI (I don’t remember).

liZe avatar May 25 '21 12:05 liZe

I'm having this issue currently and I'm not sure how to resolve it.

I've tried uninstalling and reinstalling cairocffi([xcb]) multiple times. I've uninstalled the ubuntu python3-* packages that relate to this. I've tried building and installing cairocffi locally, but nothing works.

Just to make sure this is a qtile error, is there a way to check if cairocffi is built with xcffib support?

ajoino avatar Mar 23 '23 10:03 ajoino

I tried running the code qtile runs to check if cairocffi has xcffib support and sure enough, it causes an AttributeError. I also tested some other functions names from https://github.com/Kozea/cairocffi/blob/e17b48840eab93682a551b1c4e346f6abdfdd15f/cairocffi/constants.py and none of them exists. But the basic example works, so I am very confused at the moment.

ajoino avatar Mar 23 '23 11:03 ajoino

Looking into the /usr/lib/x86_64-linux-gnu/libcairo.so.2, it contains the cairo_xcb_surface_create, despite the following code

from cairocffi import cairo
cairo.cairo_xcb_surface_create

throwing AttributeError: cffi library 'libcairo.so.2' has no function, constant or global variable named 'cairo_xcb_surface_create'.

ajoino avatar Mar 23 '23 20:03 ajoino

I fixed it by manually running cairocffi/ffi_build.py according to this comment and then installing qtile from PyPI. If i tried to install it from a cloned repo I get the error that cairocffi was not built with xcb support. I will open a separate issue in qtile about that.

ajoino avatar Mar 24 '23 09:03 ajoino