首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django Haystack - MissingDependency

Django Haystack - MissingDependency
EN

Stack Overflow用户
提问于 2017-06-09 07:20:54
回答 1查看 465关注 0票数 0

我检查了这些职位,但没有成功:

我的requirements.txt

代码语言:javascript
复制
appdirs==1.4.3
bcrypt==3.1.3
certifi==2017.4.17
cffi==1.10.0
chardet==3.0.4
construct==2.5.3
dj-database-url==0.4.2
Django==1.10.7
django-cors-headers==2.0.2
django-debug-toolbar==1.8
django-field-history==0.6.0
django-haystack==2.6.1
django-pandas==0.4.1
djangorestframework==3.6.2
drf-haystack==1.6.1
elasticsearch==2.4.1
future==0.16.0
gunicorn==19.7.1
idna==2.5
numpy==1.12.1
olefile==0.44
packaging==16.8
pandas==0.20.1
pefile==2016.3.28
Pillow==4.1.1
psycopg2==2.7.1
pycparser==2.17
pyparsing==2.2.0
python-dateutil==2.6.0
python-ptrace==0.9.2
pytz==2017.2
requests==2.17.3
simplejson==3.10.0
six==1.10.0
sqlparse==0.2.3
urllib3==1.21.1
whitenoise==3.3.0

我的settings.py

代码语言:javascript
复制
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    #===external apps===
    'rest_framework',
    'rest_framework.authtoken',
    'corsheaders',
    'field_history',
    'elasticsearch',
    'haystack',
    'debug_toolbar',
]
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
        'URL': 'http://192.168.99.100:3276/',
        'INDEX_NAME': 'crm',
    },
}

在尝试运行python manage.py rebuild_index时,我得到以下错误:

代码语言:javascript
复制
File "C:\Users\kazi_\Documents\GitHub\esar_drf\venv\lib\site-packages\haystack\backends\elasticsearch2_backend.py", line 9, in <module>
    from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend, ElasticsearchSearchQuery

File "C:\Users\kazi_\Documents\GitHub\esar_drf\venv\lib\site-packages\haystack\backends\elasticsearch_backend.py", line 33, in <module>
    raise MissingDependency("The 'elasticsearch' backend requires the installation of 'elasticsearch'. Please refer to the documentation.")
haystack.exceptions.MissingDependency: The 'elasticsearch' backend requires the installation of 'elasticsearch'. Please refer to the documentation.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-09 15:03:56

不幸的是,答案很简单。由于我的一个包名为elasticsearch,所以我遇到了命名冲突。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44451702

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档