mod_wsgi与virtualenv上的python

时间:2015-09-14 08:30:02

标签: python django apache python-2.7 mod-wsgi

我使用以下选项从源代码编译python 2.7.10:
--prefix = / path / to / alt / python --enable-shared --with-threads LDFLAGS =" -Wl, - rpath = / path / to / alt / python / lib"

在此之后,我使用以下选项编译了mod_wsgi:
--with-蟒=的/ usr / local / bin中/ python2.7

这就是我的httpd.conf文件的样子

WSGIPythonHome /path/to/project/env/
WSGIScriptAlias / /path/to/project/src/project/wsgi.py
WSGIPythonPath /path/to/project/env/lib/python2.7/site-packages
WSGIDaemonProcess project python-path=/path/to/project/env/lib/python2.7/site-packages

<VirtualHost *:80>
<Directory /path/to/project>
<Files wsgi.py>
</Files>
</Directory>
</VirtualHost>

当我尝试从浏览器访问我的项目时,收到以下错误:

Traceback (most recent call last):
  File "/path/to/project/src/project/wsgi.py", line 21, in <module>
    from django.core.wsgi import get_wsgi_application
  File "/path/to/project/env/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
    from django.utils.version import get_version
  File "/path/to/project/env/lib/python2.7/site-packages/django/utils/version.py", line 1, in <module>
    from __future__ import unicode_literals
ImportError: No module named __future__

可能是什么问题?

0 个答案:

没有答案