python 2.7.x on MacOSX: failed dlopen() on .so's

Paul Smith paul at mad-scientist.net
Wed Nov 13 17:59:43 EST 2013


Thanks for the response Ned!

On Wed, 2013-11-13 at 14:40 -0800, Ned Deily wrote:
> There shouldn't be any problems with what you are trying to do.  It
> works for me with Python 2.7.6 and pycrypto-2.6.1.  Some suggestions:
> - Avoid --enable-shared on OS X at least initially.  There are too
> many ways things can go wrong.  If you've built with it, suggest
> starting with a fresh Python source directory just to be sure.

I've tried it with all three options: no flag, --disable-shared, and
--enable-shared, and don't notice any difference in the results; even
with --enable-shared I don't seem to get any shared libs created.

> - Check the dynamic library dependencies of _struct.  On OS X:
> 
>   otool -L /Users/build/python/lib/python2.7/lib-dynload/_struct.so

I get a libgcc_s reference as well, since I'm building with GCC:

/Users/build/python/lib/python2.7/lib-dynload/_struct.so:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 159.1.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1105.0.0)

I wonder if using the GCC linker etc. is part of the problem?

> - Make sure you are *really* building pycrypto and friends with your
> Python and not with some other one.

I'm pretty sure but I'll triple-check.

The reason I've set PYTHONHOME is ultimately I need this installation to
be relocatable.  It's going to be shared across lots of different
systems and they'll have the ability to copy it wherever they want.

> - Check your other environment variables and make sure you are not
> setting any DYLD_ or LD_ env variables.

Hm; I am setting LD_LIBRARY_PATH to find the Python .so files.  Does
python figure out where to look for them by itself?

Thanks for this info; I'll get back to you.





More information about the Python-list mailing list