在 Snow Leopard 上使用 python 2.5 构建 mod_wsgi
我使用的是 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
我通读了 类似的问题。与那个人不同,我使用的是普通的 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)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用“--disable-framework”进行“配置”。这将导致 -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'.