centos,django,mod_wsgi和不同的python安装

我得到这个错误

File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module

TemplateSyntaxError: Caught ImportError while rendering: No module named django_bcrypt

django_bcrypt已经安装,可以在python shell中导入。

django_bcrypt安装在/root/src/django_bcrypt

另外我有一个旧的Python 2.4 /usr/bin/python2.4

而我的新的是/usr/local/bin/python2.7

我也有一个/usr/local/bin/python

我使用wsgi脚本检查了sys.path,sys.prefix,sys.version。一切都是正确的。

首先我有一个错误import site failed error.I通过添加WSGIPythonHome /usr/local更正

你有你的Pythonpath设置? 默认情况下, /root/src不在你的PYTHONPATH ,所以你需要将它安装到你的站点包中(推荐!),或者把这个path添加到你的PYTHONPATHvariables中。 请参阅mod_wsgi文档以了解如何执行此操作。