mod_wsgi的和python的多个安装 [英] mod_wsgi and multiple installations of python

查看:154
本文介绍了mod_wsgi的和python的多个安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是怎么样的<一个延续的href=\"http://stackoverflow.com/questions/6449400/no-module-named-os-found-django-mod-wsgi-apache-2-2\">this的问题,但它已经偏离于是我开始一个新的。我想使用Python 2.5,而不是OS X的默认2.6。我已经设置此为我的终端和诸如此类的东西,但每当Apache运行它给了我下面的错误输出:

This is kind of a continuation of this question, but it has deviated so I started a new one. I'd like to use Python 2.5 instead of OS X's default 2.6. I've set this up for my terminal and whatnot, but whenever apache runs it gives me the following error output:

[Thu Jun 23 00:01:42 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Compiled for Python/2.5.4.
[Thu Jun 23 00:01:42 2011] [warn] mod_wsgi: Runtime using Python/2.6.1.
[Thu Jun 23 00:01:42 2011] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 23 00:01:42 2011] [notice] Digest: done
[Thu Jun 23 00:01:42 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8l DAV/2 mod_wsgi/3.3 Python/2.6.1 configured -- resuming normal operations

我已经设置WSGIPythonPath以匹配sys.path中给了我在Python外壳:

I've set WSGIPythonPath to match what sys.path gives me in the python shell:

WSGIPythonPath /System/Library/Frameworks/Python.framework/Versions/2.5

仍然没有运气。想法?

Still no luck. Ideas?

推荐答案

您应该使用以下指令取决于你使用的mod_wsgi的版本

You should use the following directives depending on which version of mod_wsgi you use

有关mod_wsgi的1.x的:

For mod_wsgi 1.x:

WSGIPythonExecutable /path/to/python/2.5/exe

有关mod_wsgi的2.X:

For mod_wsgi 2.x:

WSGIPythonHome /path/to/python/2.5/exe/directory

WSGIPythonPath 只是为了自己的库添加到在WSGI环境Python路径。

The WSGIPythonPath is just intended to add your own libraries to the Python Path in the WSGI context.

链接到文档:<一href=\"http://$c$c.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable\">http://$c$c.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable

这篇关于mod_wsgi的和python的多个安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆