Open tmplt opened 3 years ago
PyFtdi does not load the native libusb library on its own, this is handled by PyUSB.
PyUSB uses the ctypes
module to load the native library, through its find_library
method:
ctypes.util.find_library(name) ... The exact functionality is system dependent. On Linux, find_library() tries to run external programs (/sbin/ldconfig, gcc, objdump and ld) to find the library file. It returns the filename of the library file. Changed in version 3.6: On Linux, the value of the environment variable LD_LIBRARY_PATH is used when searching for libraries, if a library cannot be found by any other means.
It should work with Python 3.8.5 AFAICT...
Native library loading is quite circumvolved. I do not have time for now to setup a matching test environment, could you have a look at pyusb's liblibrary
module to see if anything unexpected is invoked?
Note to self: pyftdi and deps where here packaged by pypi2nix. pyftdi is otherwise packaged (likely more proper) in nixpkgs. Try to repro.
@tmplt Try the tips here. https://github.com/pyusb/pyusb/blob/master/docs/tutorial.rst#specifying-libraries-by-hand
I have an Adafruit FT232H breakout I want to use with my Raspberry Pi, an aarch64-linux system. I'm also using NixOS, and must specify
LD_LIBRARY_PATH = "${libusb}/lib/"
.However
Running the same snippet on my laptop (an x86 system) returns the expected device descriptor.
It seems that
LD_LIBRARY_PATH
is simply ignored on the RPi; but I cannot find any usage of it in the code base to inspect and figure out the root cause.