Reputation: 51
I get this import error when trying to run
from elasticsearch_dsl import Search, A
Full traceback
ImportError: cannot import name 'Mapping' from 'elasticsearch.compat' (C:\Users\SANA\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\elasticsearch\compat.py)
elasticsearch version: 7.13.3 elasticsearch-dsl version: 7.4.0
I have tried:
from collections.abc import Mapping
And can't seem to google my way to an answer
Upvotes: 2
Views: 1279
Reputation: 46
You must have installed elasticsearch_dsl. Install elasticsearch-dsl.
Try doing :
pip uninstall elasticsearch_dsl
pip install elasticsearch-dsl
this should work.
Upvotes: 3