cannot import name RequestsHttpConnection from elasticsearch

Viewed 5773

RequestsHttpConnection was working fine until I had to reinstall Anaconda which is now using Python3.9. Form just trying to import RequestsHttpConnection. I got error below.

from elasticsearch import Elasticsearch, RequestsHttpConnection

Error: cannot import name 'RequestsHttpConnection' from 'elasticsearch' (\Anaconda3\lib\site-packages\elasticsearch_init_.py)

I have elasticsearch-8.0.0 installed and also have requests installed.

Any help is appreciated.

1 Answers

This thing is deprecated in versions 8 and above.

pip uninstall elasticsearch
pip install elasticsearch==7.13.4
Related