简体   繁体   English

Apache mod_wsgi 和 python 2.7

[英]Apache mod_wsgi and python 2.7

My WSGI installation uses python2.6 and my django project requires python 2.7 to work properly.我的 WSGI 安装使用 python2.6,而我的 django 项目需要 python 2.7 才能正常工作。 Is is possible to relink the python version WSGI uses without recompiling wsgi?是否可以在不重新编译 wsgi 的情况下重新链接 WSGI 使用的 python 版本? I've been having some odd errors trying to compile wsgi and I'd prefer to sidestep that whole troubleshooting process if possible.我在尝试编译 wsgi 时遇到了一些奇怪的错误,如果可能的话,我宁愿回避整个故障排除过程。

Thanks谢谢

To answer the specific question, no it is not possible to make a mod_wsgi installation compiled for one Python version to use a different version at run time.要回答具体问题,不,不可能为一个 Python 版本编译 mod_wsgi 安装以在运行时使用不同的版本。

Why don't you create a separate question for the actual problem you are having with compiling from source code.为什么不针对从源代码编译时遇到的实际问题创建一个单独的问题。 Better still ask it on the mod_wsgi mailing list where best people to help you can be found.最好还是在 mod_wsgi 邮件列表上询问它,在那里可以找到最好的帮助你的人。

You'll have to re-install WSGI with something like this directive您必须使用类似此指令的内容重新安装 WSGI

./configure --with-python=/usr/local/bin/python2.7

http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions http://code.google.com/p/modwsgi/wiki/InstallationIssues#Multiple_Python_Versions

If you're running multiple applications, it might be a good idea to use virtualenv and set the os.environ variables in your applications' WSGI scripts to point to their virtual environments.如果您正在运行多个应用程序,最好使用 virtualenv 并在应用程序的 WSGI 脚本中设置 os.environ 变量以指向它们的虚拟环境。

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

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