我使用的是MacOSXSnowLeopard(10.6)附带的python 2.5。我已经设置了默认值:
defaults write com.apple.versioner.python Version 2.5
通常我会得到python 2.5。
然而,当我尝试构建mod wsgi时,它似乎并不坚持。我已经用过了
--with-python=/usr/bin/python2.5
选择权
configure
强制它使用python 2.5,但是构建的共享库最终引用了python 2.6库。
我也尝试过:
-
设置
$VERSIONER_PYTHON_VERSION
建筑前2.5
-
走开
--with-python
我通读了关于
a similar SO question
. 与那个人不同,我使用的是stock mac os x python,它应该与mod wsgi构建过程中的框架代码一起工作。
下面是一些相关命令的输出。注意的最终输出
otool -L
最后显示它在python 2.6框架目录中。
$ 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)