[Pythonmac-SIG] Problem with module linking

Nicholas Riley njriley@uiuc.edu
Tue, 10 Dec 2002 12:26:22 -0600


Hi,

I'm trying to get the Python bindings for Subversion
(subversion.tigris.org) to work with Python 2.2.2 on OS X.  I've
successfully built the bindings with SWIG 1.3.17, but I have a problem
importing the modules.

% ls *.so
_client.so*  _delta.so*  _fs.so*  _ra.so*  _repos.so*  _util.so*  _wc.so*
% file _fs.so _ra.so
_fs.so: Mach-O bundle ppc
_ra.so: Mach-O bundle ppc
% otool -L _fs.so _ra.so
_fs.so:
        Python.framework/Versions/2.2/Python (compatibility version 2.2.0, current version 2.2.0)
        /usr/local/encap/subversion/lib/libsvn_fs-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 62.0.0)
_ra.so:
        Python.framework/Versions/2.2/Python (compatibility version 2.2.0, current version 2.2.0)
        /usr/local/encap/subversion/lib/libsvn_ra-1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 62.0.0)
% python
Python 2.2.2 (#14, Nov 30 2002, 15:47:39)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _fs
>>> import _ra
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Failure linking new module
>>>
% python
Python 2.2.2 (#14, Nov 30 2002, 15:47:39)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ra
>>> import _fs
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Failure linking new module
>>>

As you can see, I can import one module OK, but the second one fails.
My guess is it's something related to the linker, but I don't know
anything about how Python loads modules.  This works fine on other
platforms for other people.

-- 
=Nicholas Riley <njriley@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign