在Snow Leopard上使用python 2.5构建mod_wsgi [英] Building mod_wsgi using python 2.5 on Snow Leopard
问题描述
我正在使用Mac OS X Snow Leopard(10.6)随附的Python 2.5.我已经设置了默认值:defaults write com.apple.versioner.python Version 2.5
,通常我会得到建议的python 2.5.
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.
但是,当我尝试构建mod_wsgi时,这似乎并不成立.我在configure
中使用了--with-python=/usr/bin/python2.5
选项,以强制它使用python 2.5,但是构建的共享库最终以对python 2.6库的引用为结尾.
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.
我也尝试过:
- 在构建之前将
$VERSIONER_PYTHON_VERSION
设置为2.5 - 离开
--with-python
- setting
$VERSIONER_PYTHON_VERSION
to 2.5 before building - leaving off
--with-python
我通读了关于类似的SO问题的讨论.与那个人不同,我使用的是普通的Mac OS X python,它应该与mod_wsgi生成过程中的Frameworks代码一起使用.
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.
以下是一些相关命令的输出.请注意最后的otool -L
的最终输出,它表明它正在Python 2.6框架目录中查找.
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)
推荐答案
尝试使用'--disable-framework'进行'configure'.这将导致-L/-l用于链接Python库而不是框架链接.这是必需的,因为不知道使框架链接使用指定为当前"版本以外的版本的方法.
Try using '--disable-framework' to 'configure'. This will result in -L/-l being used to link Python library rather than framework link. This is necessary as don't know a way to make a framework link use a version other than what is designated as 'Current'.
这篇关于在Snow Leopard上使用python 2.5构建mod_wsgi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!