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

Conflict with pymongo and bson packages in MongoDB VectorStore Component #3912

Closed
joaoguilhermeS opened this issue Sep 25, 2024 · 4 comments · Fixed by #3924
Closed

Conflict with pymongo and bson packages in MongoDB VectorStore Component #3912

joaoguilhermeS opened this issue Sep 25, 2024 · 4 comments · Fixed by #3924
Assignees
Labels
bug Something isn't working

Comments

@joaoguilhermeS
Copy link
Collaborator

Bug Description

There is a problem when trying to run the MongoDB Vectorstore component, it trows an exception of: "Please install pymongo to use MongoDB Atlas Vector Store" . But the actual problem is "ImportError: cannot import name '_get_object_size' from 'bson' (/home/joao/YAITEC/langflow/langflow-3-12/env/lib/python3.12/site-packages/bson/init.py)", so my guess is that there is a conflict between the internal bson of pymongo and the bson package itself set in the poetry environment.

Checking the code I think this might be related with #3607

Reproduction

  1. Get a simple RAG template
  2. Place the MongoDB Vectorstore as the Vectorstore
  3. Set some configuration parameters (connection string, etc)
  4. Run the Flow and check the error

Expected behavior

The Data should be ingested in the MongoDB Atlas environment as new documents in the choose collection.
Here is an example that I did with Langflow some time ago: image.

Who can help?

No response

Operating System

Ubuntu Linux 22.04

Langflow Version

1.0.18

Python Version

3.12

Screenshot

image

Flow File

Vector Store RAG - MongoDB.json

@joaoguilhermeS joaoguilhermeS added the bug Something isn't working label Sep 25, 2024
@thibaultchazal
Copy link

+1

@jordanrfrazier
Copy link
Collaborator

Thanks @joaoguilhermeS for the catch, you are correct on all counts. PR has been created, will merge and get this in the next release.

A nightly build exists as well, which should pick up the change once merged - https://pypi.org/project/langflow-nightly/.

@AlexTo
Copy link

AlexTo commented Sep 26, 2024

nice, my work around now is to down grade pymongo from 4.9.1 to 4.8.0

@thibaultchazal
Copy link

Still having the error on my side. Do I need to do something on Langflow?

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

Successfully merging a pull request may close this issue.

5 participants