简体   繁体   English

在fedora 20中为python 3安装mod_wsgi

[英]Install mod_wsgi for python 3 in fedora 20

Does Feodora's mod_wsgi support python 3? Feodora的mod_wsgi是否支持python 3?

I can use virtualenv to build python 2 environment for mod_wsgi, and it works fine. 我可以使用virtualenv为mod_wsgi构建python 2环境,并且工作正常。 But when I build the environment for python 3 the error log always says: 但是,当我为python 3构建环境时,错误日志总是显示:

 ImportError: No module named site

I just use WSGIPythonHome point to /path/to/py3venv 我只是使用WSGIPythonHome指向/path/to/py3venv

How can I configure mod_wsgi for python 3? 如何为python 3配置mod_wsgi?

You cannot take a mod_wsgi compiled for one Python version and forcibly point it at a virtual environment for another Python version. 您不能采用针对一个Python版本编译的mod_wsgi并将其强行指向针对另一Python版本的虚拟环境。 The mod_wsgi binary must be compiled for the specific Python version you want to use. 必须为要使用的特定Python版本编译mod_wsgi二进制文件。

In other words, you cannot force a mod_wsgi compiled for Python 2.X, to use a virtual environment for Python 3.X. 换句话说,您不能强制为Python 2.X编译的mod_wsgi使用针对Python 3.X的虚拟环境。

So, if your mod_wsgi is for Python 2.X, remove it and install the variant of the package for Python 3, or compile it yourself from source code. 因此,如果您的mod_wsgi适用于Python 2.X,请将其删除并安装适用于Python 3的软件包的变体,或者自己从源代码进行编译。

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

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