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

cairocffi 0.7 cannot load gdk-pixbuf library #63

Closed
cdevienne opened this issue Jun 18, 2015 · 5 comments
Closed

cairocffi 0.7 cannot load gdk-pixbuf library #63

cdevienne opened this issue Jun 18, 2015 · 5 comments

Comments

@cdevienne
Copy link

with cairocffi 0.7, I get the following error:

In [1]: from cairocffi import pixbuf
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-502496f09f86> in <module>()
----> 1 from cairocffi import pixbuf

/home/cdevienne/.virtualenvs/unlish-dev/lib/python2.7/site-packages/cairocffi/pixbuf.py in <module>()
     28 
     29 gdk_pixbuf = dlopen(ffi, 'gdk_pixbuf-2.0', 'libgdk_pixbuf-2.0-0',
---> 30                     'libgdk_pixbuf-2.0.so')
     31 gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so')
     32 glib = dlopen(ffi, 'glib-2.0', 'libglib-2.0-0', 'libglib-2.0.so')

/home/cdevienne/.virtualenvs/unlish-dev/lib/python2.7/site-packages/cairocffi/__init__.pyc in dlopen(ffi, *names)
     36             pass
     37     # Re-raise the exception.
---> 38     return ffi.dlopen(names[0])  # pragma: no cover
     39 
     40 

OSError: cannot load library 'gdk_pixbuf-2.0': gdk_pixbuf-2.0: cannot open shared object file: No such file or directory

The problem does not occur with cairocffi 0.6.

Digging a little, I found that it is related to the switch from cffi.FFI to _cffi_backend.FFI:

In [1]: import cffi

In [2]: import _cffi_backend

In [3]: cffi.FFI().dlopen('gdk_pixbuf-2')
Out[3]: <cffi.api.FFILibrary_gdk_pixbuf-2 at 0x7f893a299650>

In [4]: _cffi_backend.FFI().dlopen('gdk_pixbuf-2')                                                                              
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-4-eef9364611fa> in <module>()
----> 1 _cffi_backend.FFI().dlopen('gdk_pixbuf-2')

OSError: cannot load library 'gdk_pixbuf-2': gdk_pixbuf-2: cannot open shared object file: No such file or directory

That said, I have no clue why _cffi_backend is unable to load the library. I tried setting LD_LIBRARY_PATH, with no success.

@SimonSapin
Copy link
Member

What’s the name of the .so file for PixBuf on your system? E.g. it’s /usr/lib/libgdk_pixbuf-2.0.so on mine.

@cdevienne
Copy link
Author

on my ubuntu:
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.3000.7

on the wheezy container I had the problem first:
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1

Le 18/06/2015 15:29, Simon Sapin a écrit :

What’s the name of the |.so| file for PixBuf on your system? E.g. it’s
|/usr/lib/libgdk_pixbuf-2.0.so| on mine.

@SimonSapin
Copy link
Member

I have no clue, sorry. Maybe file an issue on CFFI?

@SimonSapin
Copy link
Member

I just released v0.7.2 with this change: 729a5b8. Does it work for you?

@cdevienne
Copy link
Author

Yes it does !

Thank you Simon :-)

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