python - haystack 上没有名为查询的模块

标签 python django django-haystack pythonpath

我在我的 Windows 计算机上使用 haystack,但我意识到我的 django 应用程序需要其他更容易在 Linux 上安装的模块,所以我转移到我的 VirtualBox with Ubuntu。我在 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']

最佳答案

所以我犯了一个非常愚蠢的错误。 我使用 pip install haystack 而不是 pip install django-haystack

关于python - haystack 上没有名为查询的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11076253/

相关文章:

python - 在 python 中从 cURL GET 请求保存 .zip 文件

python - 如何在Django Oscar中启用多面搜索?

django - 将 manage.py 指向特定的 PostgreSQL 模式

django - 如何在 django taggit 中使用 django 的 Q?

django - 如何将行号添加到 tabularinline block 的每一行

Django haystack 搜索返回被排除的项目

Django-Haystack elasticsearch 预取错误

python - 使用 itertools 创建选项矩阵

python - 将元组字符串转换为字符串元组

python - 我无法获得要注册为字符串的条目。一直说是float