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 'FilterPolicy' from 'haystack.document_stores.types' #8314

Closed
sahlebrahim opened this issue Aug 30, 2024 · 4 comments

Comments

@sahlebrahim
Copy link

Describe the bug

Describe the bug
When trying to import PineconeEmbeddingRetriever from haystack_integrations.components.retrievers.pinecone, an error occurs because the import fails because of FilterPolicy not being able to be imported from haystack.document_stores.types
Error message
ImportError: cannot import name 'FilterPolicy' from 'haystack.document_stores.types'

Additional context
i have been installing various versions of haystack to solve this to no avail.
To Reproduce
from haystack_integrations.components.retrievers.pinecone import PineconeEmbeddingRetriever

System:
OS: Windows 11 Pro 23H2
GPU/CPU: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
Haystack version: 2.2.0
DocumentStore: Pinecone
Retriever: PineconeEmbeddingRetriever

@anakin87
Copy link
Member

I think FilterPolicy was introduced in haystack-ai==2.3.0.
Please update your Haystack version.

To install the latest version, you can use:
pip install -U haystack-ai

@sahlebrahim
Copy link
Author

@anakin87 i use lower versions because now i have issue ImportError: cannot import name 'HuggingFaceTGIGenerator' from 'haystack.components.generators' which popped up after using 2.3.0 or upper

@sahlebrahim
Copy link
Author

@anakin87 fyi i have tranformers==4.43.2 and huggingface_hub==0.23.2

@anakin87
Copy link
Member

HuggingFaceTGIGenerator was deprecated, then removed and can be easily replaced with HuggingFaceAPIGenerator.

You could also pin qdrant-haystack to an older version. You can check the changelog here, but I would not recommend this practice.

@github-actions github-actions bot added the stale label Sep 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants