Re: ctypes can't find files in /usr/local/lib?
"Joshua J. Kugler" <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Organization | Azariah Enterprises |
| Message-ID | <[email protected]> |
On Friday 17 September 2010, Chris Clark elucidated thus:
> 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.
I may have to do this. Still not ideal, as I'd like it to find it
automatically.
> 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.
I'm working with an existing module, so would rather not maintain
something myself. Maybe I'll add some heuristics to the module and
submit them back to the developer. :)
Other ideas as to why ctypes can't find something that *is* in the
ldconfig cache would be welcome.
Thanks.
j
--
Joshua J. Kugler - Fairbanks, Alaska
Azariah Enterprises - Programming and Website Design
[email protected] - Jabber: [email protected]
PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A
------------------------------------------------------------------------------
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