【发布时间】:2012-06-18 02:08:01
【问题描述】:
我在我的 Windows 计算机上使用 haystack,但我意识到我需要其他更易于在 Linux 上安装的 django 应用程序模块,因此我使用 Ubuntu 迁移到了 VirtualBox。我在 venv 文件夹中安装了所有带有 virtualenv 的东西。基本上,我的应用程序使用带有 Whoosh 后端的 haystack。
在 view.py 上,在导入行上,当我执行 from haystack.query import SearchQuerySet 时,它会引发 No module named query 错误。有什么想法可能是错的吗?这是整个错误。我怀疑我在 Python 路径上做错了什么。我在虚拟环境上用 pip 安装了所有东西。
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4
Exception Type: ImportError
Exception Value:
No module named query
Exception Location: /home/app/dj/venv/theme/../theme/views.py in <module>, line 10
Python Executable: /home/app/dj/venv/bin/python
Python Version: 2.7.3
Python Path:
['/home/app/dj/venv/theme',
'/home/app/dj/venv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/app/dj/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/app/dj/venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/app/dj/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/app/dj/venv/lib/python2.7',
'/home/app/dj/venv/lib/python2.7/plat-linux2',
'/home/app/dj/venv/lib/python2.7/lib-tk',
'/home/app/dj/venv/lib/python2.7/lib-old',
'/home/app/dj/venv/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/app/dj/venv/local/lib/python2.7/site-packages',
'/home/app/dj/venv/lib/python2.7/site-packages']
【问题讨论】:
标签: python django django-haystack pythonpath