I want to create package for python that embeds and uses an external library (.so
) on Linux using the cffi module.
Is there standard way to include .so
Wheels are the standard way of distributing Python packages, but there is a problem when you have extension modules that depend on other so
's. This is because the normal Linux dynamic linker is used, and that only looks in /usr/lib
or /usr/local/lib
. This is a problem when installing a wheel in a virtualenv
.
As far as I know, you have three options:
ctypes
to wrap the so
directly from Python;/usr/lib
or /usr/local/lib
.A wheel may work if you include the dependent so
as a data file to be stored in /lib
and install into the root Python environment (haven't tried that), but this will break if someone tries to install the wheel into a virtualenv (did try that).