Django+haystack实现全文搜索出现错误 ImportError: cannot import name signals
2018-08-19 21:17
811 查看
原因是在你的settings.py或者其他地方使用了 "import haystack"
当我们使用django-haysatck库时,表面上会有haystack库,但实际上并不存在,
当你使用 import haystack 时,在haystack使用__init__初始化会 from haystack import signs,就会出现没有signals模块,
因为haysatck这个库本身就不存在。
如果你选择安装haystack这个库(pip install haystack),就会出现这样的错误:
from haystack import connections ImportError: cannot import name connections
这是因为haysatck库和django-haystack库冲突,所以你必须卸载haystack。
任何地方都不要使用 import haystack。
相关文章推荐
- 解决bs4在Python 3.5下出现“ImportError: cannot import name 'HTMLParseError'”错误
- 解决bs4在Python 3.6下出现“ImportError: cannot import name 'HTMLParseError'”错误
- tensorflow 出现ImportError: cannot import name graph_util
- Ubuntu16.04 下安装django出现ImportError: cannot import name patterns
- 网络爬虫在Python 3.5下出现“ cannot import name 'HTMLParseError'”错误解决办法
- keras编译出现 ImportError: cannot import name Merge
- 解决使用drf-haystack报错ImportError: cannot import name get_count
- 安装beautifulsoup4 时出现 ImportError: cannot import name 'beautifulsoup'
- [python] 关于错误 ImportError: cannot import name compile_command
- tensorflow 出现ImportError: cannot import name graph_util
- python 错误: ImportError: cannot import name xxx
- ImportError: cannot import name ABCMeta 问题解决
- Django 错误 cannot import name
- [Django]ImportError:cannot import name debug问题
- python中调用 imread 报错: ImportError: cannot import name imread
- cannot import name 'Flask' 的错误
- ubuntu16.04 tensorflow 报错 ImportError: cannot import name 'audio_ops'
- carbon报错 Python Error - ImportError: cannot import name daemonize
- 关于Eclipse for Android安装SDK过程中出现的错误——The import android.support cannot be resolved
- python MySQLdb ImportError: cannot import name conversions 解决办法