dynamically loaded modules (.so files) does not work under openbsd

Kiyo Kelvin Lee kiyolee*remove* at ctimail.com
Thu Oct 26 08:24:59 EDT 2000


"Courageous" <jkraska1 at san.rr.com> wrote in message
news:39F7CB6E.7B8D1CF2 at san.rr.com...
> Kiyo Kelvin Lee wrote:
> >
> > Under OpenBSD, I can't make dynamically loaded modules work.
> > Python responsed with "ImportError: dynamic modules does not define init
> > function (initXYZ)" upon import XYZ.
> > Any ideas?
> > Kiyo
>
> The problem sounds as if the module doesn't have an init function.
> Are you writing this module? Is it written in C? In a C module,
> there must be a function named init[module-name]. So for a module
> named "XYZ" a function "initXYZ" must exist.
>
No. I am using standard modules. The same result was obtained when I tried
to import either zlib or sha for examples. BTW, noted that the same setup
compiled and ran properly when not compiled using shared library dynamic
modules.

> I suppose something which could cause this error to occur would
> be the presence of a library XYZ.so somewhere in your LD_LIBRARY_PATH
> ahead of the library you really wanted to import. This could cause
> great confusion.
>
No. After python is compiled and linked, it's smart enough to look for
dynamic modules from the directory {python-src}/Modules. You don't need to
set LD_LIBRARY_PATH. And actually, {python-src}/Modules/zlibmodule.so exists
after compilation. If you rename the file to something else, python reports
"module does not exist" instead of the above error.

> I've never seen this problem myself, however.
>
So do I. It works under linux. So I am wondering if it's a problem of
OpenBSD.

>
>
> C//




More information about the Python-list mailing list