Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local install fails- cannot import name 'DocType' from 'elasticsearch_dsl' #6560

Closed
AkashDhiman opened this issue Oct 29, 2019 · 1 comment · Fixed by #6557
Closed

local install fails- cannot import name 'DocType' from 'elasticsearch_dsl' #6560

AkashDhiman opened this issue Oct 29, 2019 · 1 comment · Fixed by #6557

Comments

@AkashDhiman
Copy link
Member

I was following the steps listed here, when I encountered the problem.

Things I did

  1. git cloned the repository.
  2. setup a virtual environment with python3.7
  3. created the default user and databases exactly as shown via postgresql
  4. executed step 5 and python3 create_db returned error

cannot import name 'DocType' from 'elasticsearch_dsl'

Stacktrace

Traceback (most recent call last): File "create_db.py", line 7, in <module> from app import current_app File "~/fossasia/open-event-server/app/__init__.py", line 36, in <module> from app.api.helpers.jwt import jwt_user_loader File "~/fossasia/open-event-server/app/api/__init__.py", line 1, in <module> from app.api.access_codes import AccessCodeList, AccessCodeListPost, AccessCodeDetail, AccessCodeRelationshipRequired, \ File "~/fossasia/open-event-server/app/api/access_codes.py", line 5, in <module> from app.api.bootstrap import api File "~/fossasia/open-event-server/app/api/bootstrap.py", line 3, in <module> from app.api.helpers.permission_manager import permission_manager File "~/fossasia/open-event-server/app/api/helpers/permission_manager.py", line 9, in <module> from app.models.event import Event File "~/fossasia/open-event-server/app/models/event.py", line 19, in <module> from app.models.search import sync File "~/fossasia/open-event-server/app/models/search/sync.py", line 11, in <module> from app.models.search.event import SearchableEvent File "~/fossasia/open-event-server/app/models/search/event.py", line 2, in <module> from elasticsearch_dsl import DocType, Integer, Search, Text ImportError: cannot import name 'DocType' from 'elasticsearch_dsl' (~/fossasia/open-event-server/venv/lib/python3.7/site-packages/elasticsearch_dsl/__init__.py)

**Additional details: **

  • OS: debian 9
  • Python Version: 3.7.3

Additional context
On exploring, I tried changing the version of elasticsearch_dsl in requirements to 6.1.0 and sure enough that solves the problem, should i make a PR with the fix?

@iamareebjamal
Copy link
Member

Ensure you have pulled the latest changes and retry

This was already fixed in #6557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants