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

Incompatibility of python 3.10 and elasticsearch 7.10 with Haystack 1.5 #2628

Closed
julian-risch opened this issue Jun 2, 2022 · 2 comments · Fixed by #2735
Closed

Incompatibility of python 3.10 and elasticsearch 7.10 with Haystack 1.5 #2628

julian-risch opened this issue Jun 2, 2022 · 2 comments · Fixed by #2735
Labels
type:bug Something isn't working

Comments

@julian-risch
Copy link
Member

julian-risch commented Jun 2, 2022

Describe the bug
The new Haystack v1.5.0 release supports python 3.10. However, I came across an incompatibility issue/a small bug in the elasticsearch client 7.10 and python 3.10.

The error message is as follows when running python tutorials/Tutorial1_Basic_QA_Pipeline.py:

INFO - haystack.document_stores.base -  Numba not found, replacing njit() with no-op implementation. Enable it with 'pip install numba'.
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310_v150/lib/python3.10/site-packages/elasticsearch/compat.py", line 36, in <module>
    from collections.abs import Mapping
ModuleNotFoundError: No module named 'collections.abs'

So there is a typo collections.abs instead of collections.abc in the elasticsearch client, which lets the import fail.

It was fixed here:
elastic/elasticsearch-py@cf39af3

Downgrading the elasticsearch client to 7.9 worked for me. Maybe we should upgrade the client in the setup config (7.10 is currently the upper limit)? Another option would be to exclude version 7.10 for now but so far not many people seem to be using Haystack with python 3.10. What are your thoughts?

@julian-risch julian-risch added the type:bug Something isn't working label Jun 2, 2022
@masci
Copy link
Contributor

masci commented Jun 6, 2022

v7.10.1 contains the fix you mention, I'd just adjust our setup.cfg to include that too with elasticsearch>=7.7,<7.11

@moravveji
Copy link

As a quick workaround, I just installed a conda environment with a base Python 3.9 (instead of 3.10), and then I could successfully import haystack, without the ImportError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants