Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot import name RequestsHttpConnection from elasticsearch

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.

like image 619
Shaggy Avatar asked Dec 13 '25 06:12

Shaggy


1 Answers

This thing is deprecated in versions 8 and above.

pip uninstall elasticsearch
pip install elasticsearch==7.13.4
like image 136
sarvesh_r Avatar answered Dec 15 '25 20:12

sarvesh_r