Building mod_wsgi using python 2.5 on Snow Leopard

自闭症网瘾萝莉.ら 提交于 2019-12-07 14:26:11

问题


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)

回答1:


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'.



来源:https://stackoverflow.com/questions/3534508/building-mod-wsgi-using-python-2-5-on-snow-leopard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!