Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import on ubuntu 24.04 #173

Open
timeyyy opened this issue Jan 1, 2025 · 5 comments
Open

Unable to import on ubuntu 24.04 #173

timeyyy opened this issue Jan 1, 2025 · 5 comments

Comments

@timeyyy
Copy link

timeyyy commented Jan 1, 2025

I have the ubuntu deps installed with apt.

>>> import xcffib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tim/programming/repo/system_hotkey/myenv/lib/python3.12/site-packages/xcffib
/__init__.py", line 35, in <module>
    lib = ffi.dlopen(soname)
          ^^^^^^^^^^^^^^^^^^
  File "/home/tim/programming/repo/system_hotkey/myenv/lib/python3.12/site-packages/cffi/a
pi.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tim/programming/repo/system_hotkey/myenv/lib/python3.12/site-packages/cffi/a
pi.py", line 834, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tim/programming/repo/system_hotkey/myenv/lib/python3.12/site-packages/cffi/a
pi.py", line 829, in _load_backend_lib
    raise OSError(msg)
OSError: cannot load library 'libxcb.so.1': libxcb.so.1: cannot open shared object file: N
o such file or directory.  Additionally, ctypes.util.find_library() did not manage to loca
te a library called 'libxcb.so.1'
@tych0
Copy link
Owner

tych0 commented Jan 1, 2025

Do you have the .so in question?

@timeyyy
Copy link
Author

timeyyy commented Jan 2, 2025

I'm not really sure what that really means. I've done apt install libxcb1 and the -dev package. Other than that i'm guessing that i don't have the .so, how do i get it? 🙈

@tych0
Copy link
Owner

tych0 commented Jan 2, 2025

It should be in the libxcb1 package (you can verify it's present with ldconfig -v); otherwise it's probably the venv interfering with the search path? I don't really know how all that works, but you could try with --break-system-packages and see if that helps.

@timeyyy
Copy link
Author

timeyyy commented Jan 2, 2025

it's in there (ldconfig -v i mean),

I already tried the --break-system-packages, i just thought i'd check in here if it was something obvious. My system is probably broken...

@tych0
Copy link
Owner

tych0 commented Jan 2, 2025

If it's not imported via the globally installed version then something else is wrong with the system. The error you posted here is from a venv, though, which can interfere with native libraries sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants