【发布时间】:2011-04-01 20:39:59
【问题描述】:
我使用的是 Mac OS X Snow Leopard (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 上的讨论。与那个人不同,我使用的是 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)
【问题讨论】: