myarik / django-rest-elasticsearch

Elasticsearch support for Django REST Framework
Other
192 stars 38 forks source link

ImportError: cannot import name 'Attachment' #27

Closed kabrice closed 6 years ago

kabrice commented 6 years ago

Hello,

With the following environment

Django==2.0.1
django-elasticsearch-dsl==0.4.4
django-elasticsearch-dsl-drf==0.6.3
django-nine==0.1.13
djangorestframework==3.7.7
elasticsearch==6.1.1
elasticsearch-dsl==6.1.0
ipaddress==1.0.19
psycopg2==2.7.3.2
python-dateutil==2.6.1
pytz==2017.3
PyYAML==3.12
six==1.11.0
urllib3==1.22

I have now the following error when launching Django :

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django/apps/registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django_elasticsearch_dsl/__init__.py", line 3, in <module>
    from .documents import DocType  # noqa
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django_elasticsearch_dsl/documents.py", line 13, in <module>
    from .fields import (
  File "/home/ubuntu/.virtualenvs/book_es/lib/python3.5/site-packages/django_elasticsearch_dsl/fields.py", line 9, in <module>
    from elasticsearch_dsl.field import (
ImportError: cannot import name 'Attachment'

The documentation indicates "Django REST Framework 3.5 and above and elasticsearch-dsl>=5.0.0,<7.0.0 (Elasticsearch 5.x).

Please what's wrong ?

thank you

dmvass commented 6 years ago

@kabrice you wrong the project and i think that problem in https://github.com/sabricot/django-elasticsearch-dsl