这是 this 的延续问题,但它已经偏离了,所以我开始了一个新的。我想使用 Python 2.5 而不是 OS X 的默认 2.6。我已经为我的终端和诸如此类的东西进行了设置,但是每当 apache 运行时,它都会给我以下错误输出:
[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 shell 中给我的内容:
WSGIPythonPath /System/Library/Frameworks/Python.framework/Versions/2.5
仍然没有运气。想法?
最佳答案
您应该使用以下指令,具体取决于您使用的 mod_wsgi 版本
对于 mod_wsgi 1.x:
WSGIPythonExecutable /path/to/python/2.5/exe
对于 mod_wsgi 2.x:
WSGIPythonHome /path/to/python/2.5/exe/directory
WSGIPythonPath
只是为了将您自己的库添加到 WSGI 上下文中的 Python 路径中。
文档链接:http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonExecutable
关于python - mod_wsgi 和 python 的多个安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6450459/