Re: ctypes can't find files in /usr/local/lib?
Chris Clark <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
Joshua J. Kugler wrote:
> Long time Python use, new to ctypes (by way of a module I'm trying).
>
> This is Ubuntu 9.04, Python 2.6
>
> I have some libraries in /usr/local/lib.
>
> ....
> This library loads just fine when I copy it all to /usr/lib.....
>>>> ctypes.cdll.LoadLibrary ("libowcapi.so")
>>>>
> <CDLL 'libowcapi.so', handle 9ddcc58 at 9e1386c>
>
> Another data point, if I do a symlink:
>
> /usr/lib/libowcapi.so -> /usr/local/lib/libowcapi.so
>
> And run ldconfig, I can then load it with ctypes.
>
> Oh, and an strace of the python process shows that it never tries
> anything in /usr/local/lib.
>
> Any ideas?
>
You can specify full paths, not just the lib name. That is probably the
quickest solution.
The ctypegen (http://code.google.com/p/ctypesgen/) project has some
heuristics for finding libs, so you don't have to play around with this
sort of stuff. The heuristics may not be complete but it is worth
checking out.
Chris
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev