Python: ImportError: cannot import name 'E' from 'elasticsearch.esql'

peter9
Thu, 21 Aug 2025 11:41:07 +0000
Elasticsearch

I am reading the docs at ES|QL Query Builder | Python

There are examples that start with:

from elasticsearch.esql import ESQL, E

When I try these, I get:

ImportError: cannot import name 'E' from 'elasticsearch.esql'

I need this to preventing injection attacks. How do I fix this?

Elasticsearch version 9.1.2

Python Elasticsearch version 9.1.0

Python version 3.10.18

4 posts - 3 participants