gpt4 book ai didi

python - Snow Leopard 上的 mod_wsgi python 版本不匹配

转载 作者:行者123 更新时间:2023-12-01 06:18:26 26 4
gpt4 key购买 nike

我尝试在 Mac OS X 10.6 上使用非默认 python 安装在 Apache 2.2.14 下运行 mod_wsgi 3.1。

下载 mod_wsgi 源代码后,我运行:

sudo apachectl -k stop

然后

./configure --with-python=/usr/local/Cellar/python/2.6.4/bin/python
make
sudo make install

然后我再次启动 apache

sudo apachectl -k start

当我 cat/var/log/httpd/error_log 时,我看到:

[Mon Dec 21 12:27:26 2009] [warn] mod_wsgi: Compiled for Python/2.6.4.

[Mon Dec 21 12:27:26 2009] [warn] mod_wsgi: Runtime using Python/2.6.1.

[Mon Dec 21 12:27:26 2009] [notice] Apache/2.2.14 (Unix) DAV/2 mod_wsgi/3.1 Python/2.6.1 configured -- resuming normal operations

当我运行 otool -L mod_wsgi.so 时,会看到:

mod_wsgi.so:

/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

什么给了?为什么要和系统框架 Hook ?

这是我的 mod_wsgi 配置和构建命令的输出:

<小时/>

阿基米德:mod_wsgi-3.1 awolf$ ./configure --with-python=/usr/local/Cellar/python/2.6.4/bin/python

正在检查 apxs2...否

正在检查 apxs.../opt/apache2/bin/apxs

正在检查 Apache 版本...2.2.14

配置:创建./config.status

config.status:创建Makefile

阿基米德:mod_wsgi-3.1 awolf$ make

/opt/apache2/bin/apxs -c -I/usr/local/Cellar/python/2.6.4/include/python2.6 -DNDEBUG -Wc,'-arch x86_64' mod_wsgi.c -L/usr/local/Cellar/python/2.6.4/lib -L/usr/local/Cellar/python/2.6.4/lib/python2.6/config -arch x86_64 -lpython2.6 -ldl/Library/Webserver/build/libtool --silent --mode=编译 gcc -prefer-pic -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -g -O2 -I/opt/apache2/include -I/opt/apache2/include -I/opt/apache2/include -arch x86_64 -I/usr/local/Cellar/python/2.6.4/include/python2.6 -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo

在/usr/local/Cellar/python/2.6.4/include/python2.6/Python.h:125 包含的文件中,

             from mod_wsgi.c:135:

/usr/local/Cellar/python/2.6.4/include/python2.6/modsupport.h:27:警告:“PyArg_ParseTuple”是无法识别的格式函数类型/Library/Webserver/build/libtool --silent --mode=link gcc -o mod_wsgi.la -rpath/opt/apache2/modules -module -avoid-version mod_wsgi.lo -L/usr/local/Cellar/python/2.6.4/lib -L/usr/local/Cellar/python/2.6.4/lib/python2.6/config -arch x86_64 -lpython2.6 -ldl

阿基米德:mod_wsgi-3.1 awolf$ sudo make install

密码:

/opt/apache2/bin/apxs -i -S LIBEXECDIR=/opt/apache2/modules -n 'mod_wsgi' mod_wsgi.la

/Library/Webserver/build/instdso.sh SH_LIBTOOL='/Library/Webserver/build/libtool' mod_wsgi.la/opt/apache2/modules

/Library/Webserver/build/libtool --mode=install cp mod_wsgi.la/opt/apache2/modules/

cp .libs/mod_wsgi.so/opt/apache2/modules/mod_wsgi.so

cp .libs/mod_wsgi.lai/opt/apache2/modules/mod_wsgi.la

cp .libs/mod_wsgi.a/opt/apache2/modules/mod_wsgi.a

chmod 644/opt/apache2/modules/mod_wsgi.a

ranlib/opt/apache2/modules/mod_wsgi.a

最佳答案

这篇文章很旧,但仍然出现在有关 mac + homebrew + python 的搜索中,所以我想我应该添加一些有用的信息。我作为OP遇到了问题,只是使用了不同的模块(uwsgi)。我了解到你不必放弃自制软件。事实上,Homebrew 可以安装 python 作为框架;你只需要告诉它这样做:

% brew uninstall python
Uninstalling /usr/local/Cellar/python/2.7.2...
% brew install python --universal --framework

...一切都很好。

关于python - Snow Leopard 上的 mod_wsgi python 版本不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1942462/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com