简体   繁体   English

在Snow Leopard上使用python 2.5构建mod_wsgi

[英]Building mod_wsgi using python 2.5 on Snow Leopard

I'm using the Python 2.5 that came with Mac OS X Snow Leopard (10.6). 我正在使用Mac OS X Snow Leopard(10.6)附带的Python 2.5。 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. 我已经设置了默认值: defaults write com.apple.versioner.python Version 2.5 ,通常我得到python 2.5,因为它建议。

However when I try to build mod_wsgi, that doesn't seem to adhere. 但是当我尝试构建mod_wsgi时,似乎并没有坚持。 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. 我已经使用--with-python=/usr/bin/python2.5选项来configure强制它使用python 2.5,但是构建的共享库最终会引用python 2.6库。

I've also tried: 我也尝试过:

  • setting $VERSIONER_PYTHON_VERSION to 2.5 before building 在构建之前将$VERSIONER_PYTHON_VERSION设置$VERSIONER_PYTHON_VERSION 2.5
  • leaving off --with-python 离开--with-python

I read through the discussion on a similar SO question . 我通读了关于类似SO问题的讨论。 Unlike that person, I'm using stock Mac OS X python which should work with the Frameworks code in the mod_wsgi build process. 与那个人不同,我使用的是Mac OS X python,它应该与mod_wsgi构建过程中的Frameworks代码一起使用。


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. 注意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)

Try using '--disable-framework' to 'configure'. 尝试使用'--disable-framework'来'配置'。 This will result in -L/-l being used to link Python library rather than framework link. 这将导致-L / -l用于链接Python库而不是框架链接。 This is necessary as don't know a way to make a framework link use a version other than what is designated as 'Current'. 这是必要的,因为不知道如何使框架链接使用除指定为“当前”之外的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM