# Can we use Elasticsearch-dsl-py 7.4 with Elasticsearch-8.x?

**URL:** <https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 11, 2022, 6:21am UTC](https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402 "2022-03-11T06:21:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dheeraj\_Gupta](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@Dheeraj\_Gupta](https://discuss.elastic.co/u/Dheeraj_Gupta)\
**Post date:** [March 11, 2022, 6:21am UTC](https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402/1 "2022-03-11T06:21:00Z")

</div>

We have some Python programs that use Elasticsearch-dsl-py and Elasticsearch-py Python clients to process Elasticsearch data. We are considering upgrading to Elasticsearch-8. From PyPI we can see that `elasticsearch-py-8.1.0` is available. However, `elasticsearch-dsl` is still at `7.4.0`. The DSL documentation explicitly states that

```auto
The library is compatible with all Elasticsearch versions since 2.x but you have to use a matching major version:

For Elasticsearch 7.0 and later, use the major version 7 (7.x.y) of the library.

```

Is use of Elasticsearch-DSL-7.4 supported for Elasticsearch-8.x? Or is there a plan to release a v8 of the client?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 11, 2022, 6:21am UTC](https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402/2 "2022-03-11T06:21:01Z")

</div>

Elasticsearch 7.0 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![Dheeraj\_Gupta](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@Dheeraj\_Gupta](https://discuss.elastic.co/u/Dheeraj_Gupta)\
**Post date:** [March 14, 2022, 10:05am UTC](https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402/3 "2022-03-14T10:05:03Z")

</div>

To answer my own question

- `elasticsearch-dsl-7.4.0` enforces a require dependency on `elasticsearch-7.x` so it is impossible to install both `elasticsearch==8.x` and `elasticsearch-dsl` on same environment.
- We have worked around this limitation by creating a temporary local package `7.4.1` in which the requirement for `elasticsearch` is loosened (`>=7.0,<9.0`).
- Since we also only use the `Search()` API for `Elasticsearch-DSL`, we were able to use `elasticsearch-dsl` as it is with Elasticsearch-8.x

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 11, 2022, 10:05am UTC](https://discuss.elastic.co/t/can-we-use-elasticsearch-dsl-py-7-4-with-elasticsearch-8-x/299402/4 "2022-04-11T10:05:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
