ctypes CDLL - which paths are searched?

Thomas Heller theller at ctypes.org
Tue Jan 22 08:42:43 EST 2008


Helmut Jarausch schrieb:
> Thomas Heller wrote:
>> Helmut Jarausch schrieb:
>>> Hi,
>>>
>>> how can I specify the paths to be searched for a dynamic library
>>> to be loaded by ctypes' CDLL class on a Linux system.
>>>
>>> Do I have to set os.environment['LD_LIBRARY_PATH'] ?
>>>
>> 
>> ctypes passes the argument given to CDLL(path) straight to
>> the dlopen(3) call, so your system documentation should tell you.
>> 
> 
> Thanks,
> 
> but then it's difficult to use CDLL. Setting
> os.environ['LD_LIBRARY_PATH'] within the script which
> calls CDLL is too late.
> What other methods are possible rather than put an explicit
> export LD_LIBRARY_PATH=...
> before running the script, if I don't want to put the dynamic
> library into a standard system library.

I guess you can also use an absolute pathname (but the dlopen(3)
manpage should tell you more.  I'm not too familiar with linux).

Thomas




More information about the Python-list mailing list