Building python2.5 extensions under MacPorts

Eric Tiffany etiffany at
Mon May 12 17:52:11 PDT 2008

I have had trouble with python grabbing the wrong lib versions, too.  My
solution was to set DYLD_LIBRARY_PATH to the correct thing (/opt/local/lib)
in both the build environment AND the runtime env.  Others have different

There was a similar thread on the LXML mailing list, part of which can be
found here:

The thread seems to have been broken, so to see the whole thing you'll need
to look at all the threads in that group.  But I think that segment of the
thread has most of the juicy bits.


On 5/12/08 5:25 PM, "Robert Liesenfeld" <xunil at> wrote:

> Anyone built any Python extensions, specifically for Python 2.5?  I'm
> trying to make a py25-pyqt4 port, and i'm running into trouble with
> building the extension .so's; they keep getting linked against the
> system (i.e. Apple-provided) Python, not the MacPorts Python:
> ~/Projects/ports/python/py25-pyqt4/work/PyQt-mac-gpl-4.3.3/Qt $ otool -
> L
> /System/Library/Frameworks/Python.framework/Versions/2.5/Python
> (compatibility version 2.5.0, current version 2.5.1)
> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
> version 7.4.0)
> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
> version 1.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version 111.0.0)
> This seems to be due to the fact that the python25 port is configured
> with frameworks explicitly disabled (--disable-frameworks passed to
> configure).  Obviously this incorrect linkage causes problems:
> $ /opt/local/bin/python2.5
> Python 2.5.2 (r252:60911, May  8 2008, 00:00:59)
> [GCC 4.0.1 (Apple Inc. build 5478)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import Qt
> Fatal Python error: Interpreter not initialized (version mismatch?)
> Abort trap
> I'll admit I'm a little out of my depth here, having never done much
> with Qt or Python extensions before.  I hope someone can shed some
> light on how I would convince the linker to link against the python25
> port, especially since there's no Python.framework to be found under
> the MacPorts hierarchy.
> Thanks!
> -Robert "Xunil96" Liesenfeld
> _______________________________________________
> macports-dev mailing list
> macports-dev at

More information about the macports-dev mailing list