Building python2.5 extensions under MacPorts

Robert Liesenfeld xunil at
Mon May 12 17:25:52 PDT 2008

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 - 
(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.


-Robert "Xunil96" Liesenfeld

More information about the macports-dev mailing list