在Snow Leopard上使用python 2.5构建mod_wsgi

时间:2010-08-20 20:10:12

标签: python macos 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

我通读了关于a similar SO question的讨论。与那个人不同,我使用的是Mac OS X python,它应该与mod_wsgi构建过程中的Frameworks代码一起使用。


这是一些相关命令的输出。请注意最后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)

1 个答案:

答案 0 :(得分:2)

尝试使用'--disable-framework'来'配置'。这将导致-L / -l用于链接Python库而不是框架链接。这是必要的,因为不知道如何使框架链接使用除指定为“当前”之外的版本。