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

ImportError: cannot import name 'RequestsHttpConnection' from 'elasticsearch' #91

Open
ffMathy opened this issue Mar 10, 2023 · 5 comments

Comments

@ffMathy
Copy link

ffMathy commented Mar 10, 2023

I am getting the following error when I try to use the package:

File "/usr/local/lib/python3.7/site-packages/elasticecslogging/handlers.py", line 14, in
from elasticsearch import Elasticsearch, RequestsHttpConnection
ImportError: cannot import name 'RequestsHttpConnection' from 'elasticsearch' (/usr/local/lib/python3.7/site-packages/elasticsearch/init.py)

Here's my requirements.txt:

ftrack-python-api==2.3.0
ElasticECSHandler==1.0.3
elasticsearch==8.6.2
requests==2.28.2
@thoscilo
Copy link

thoscilo commented Mar 28, 2023

Hi,

As a quick W/A I have set elasticsearch to last 7.x version in PR #92.

Another, local W/A is to call:

pip uninstall elasticsearch
pip install elasticsearch==7.17.9

@drumadrian
Copy link
Collaborator

Hi @ffMathy

Did the recommended workaround from @thoscilo help?

@ffMathy
Copy link
Author

ffMathy commented Apr 2, 2023

I can't downgrade to 7 unfortunately.

@thoscilo
Copy link

thoscilo commented Apr 3, 2023

@ffMathy, @drumadrian - I have managed locally fix this problem and update the usage of elasticsearch in version 8.X and successfully ingested logs to my ELK stack.

Right now I was able to test it with my custom auth method (LDAP with login and password provided directly - in plans to add as new PR too).

I will test other auth methods and create fix PR with result's.

@thoscilo
Copy link

thoscilo commented Apr 6, 2023

@ffMathy, @drumadrian - you can check the #93 PR.
It should fix the original problem reported.

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

No branches or pull requests

3 participants