deepset-ai / haystack

:mag: AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
16.98k stars 1.86k forks source link

Cannot use OpenAIGenerator or HuggingFaceLocalGenerator on Databricks - package conflict? #7751

Closed lukasz-kastelik closed 2 months ago

lukasz-kastelik commented 4 months ago

Describe the bug While importing from haystack.components.generators import OpenAIGenerator or from haystack.components.generators import HuggingFaceLocalGenerator on Databricks Runtime 14.3 LTS or 15.1 ML you get an error: Error message Error that was thrown (if available)

Expected behavior cannot import name 'Iterator' from 'typing_extensions' (/databricks/python/lib/python3.10/site-packages/typing_extensions.py)

Additional context Full list of Python dependencies available in Databricks is listed here: https://docs.databricks.com/en/release-notes/runtime/14.3lts.html

To Reproduce Provision a Databricks cluster and install the newest verstion of haystack-ai using pip.

FAQ Check

anakin87 commented 4 months ago

Hey!

The issue seems similar to this stack overflow thread.

Which version of typing-extension is installed? Can you upgrade it to typing-extension>=4.7?

(probably a duplicate of #7647)

lukasz-kastelik commented 4 months ago

Hey!

The issue seems similar to this stack overflow thread.

Which version of typing-extension is installed? Can you upgrade it to typing-extension>=4.7?

(probably a duplicate of #7647)

I tried %pip install --force-reinstall typing-extensions>=4.7 with no effect

anakin87 commented 4 months ago

Has the new version of typing-extensions been correctly installed? Please check the output of ! pip freeze|grep typing...

If yes, can you force reinstalling Haystack and restarting the kernel (IDK if this is feasible on databricks)?