pylibtiff
pylibtiff copied to clipboard
`find_library` won't search `LD_LIBRARY_PATH` on Linux (need workaround)
This is a problem that arises with this line ( https://github.com/pearu/pylibtiff/blob/master/libtiff/libtiff_ctypes.py#L41 ). On Mac, one can set DYLD_LIBRARY_PATH
and this has the expected behavior when using find_library
. However, this is not the case on Linux with LD_LIBRARY_PATH
. See this discussion about the issue in Python. ( https://bugs.python.org/issue2936 ) However, if LD_LIBRARY_PATH
is set, this line ( https://github.com/pearu/pylibtiff/blob/master/libtiff/libtiff_ctypes.py#L43 ) will import the library given the right name (e.g. libtiff.so
or libtiff.dylib
) even though find_library
fails. Also, PATH
is not used on Mac.
Is this still the issue?
Since the workaround is integrated, we are able to avoid this problem I think.
The only other thing that might be worth adding to the library search logic is this sys.prefix
suggestion. That should work in a variety of situations. With the Conda python
package in conda-forge
and defaults
specifically, we also have this patch, which does that sys.prefix
check for us.