I'm using the Python 2.5 that came with Mac OS X Snow Leopard (10.6). I've set the defaults value: defaults write com.apple.versioner.python Version 2.5
and normally I get python 2.5 as it suggests.
However when I try to build mod_wsgi, that doesn't seem to adhere. I've used the --with-python=/usr/bin/python2.5
option to configure
to force it to use python 2.5 but the shared library which is built ends up with references to the python 2.6 libraries.
I've also tried:
- setting
$VERSIONER_PYTHON_VERSION
to 2.5 before building - leaving off
--with-python
I read through the discussion on a similar SO question. Unlike that person, I'm using stock Mac OS X python which should work with the Frameworks code in the mod_wsgi build process.
Here's output of some relevant commands. Note the final output of otool -L
at the end which shows that it is looking in the Python 2.6 framework directory.
$ make distclean
rm -rf .libs
rm -f mod_wsgi.o mod_wsgi.la mod_wsgi.lo mod_wsgi.slo mod_wsgi.loT
rm -f config.log config.status
rm -rf autom4te.cache
rm -f Makefile Makefile.in
$ ./configure --with-python=/usr/bin/python2.5
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.14
configure: creating ./config.status
config.status: creating Makefile
$ make
(compilation messages, no errors)
$ otool -L .libs/mod_wsgi.so
.libs/mod_wsgi.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)