I have a package require a.so which load b.so and load it by ctypes.cdll.LoadLibrary(a_so_path).
So I have to ship them with my package.
Here are two idea for it.
- set
LD_LIBRARY_PATHto my site-package
Now the problem is, how can I change lib load path in the runtime, set LD_LIBRARY_PATH in my module will not work(refer to Set LD_LIBRARY_PATH before importing in python). But it is a package, I can not make every user load python in a shell script which set LD_LIBRARY_PATH to ***/lib/python3.8/site-packages/mypackage/lib/.
- install
*.soto system lib
I found data_files in setup.cfg can distribute files out of site-packages ( to /usr/lib where can be find). But unfortunately, it not support egg or wheel package. see https://packaging.python.org/guides/distributing-packages-using-setuptools/#id55
So, what is the right way to release my package?