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

PgVectorRM: dspy 2.5.6 does not provide the extra 'pgvector' #1607

Closed
excubo-jg opened this issue Oct 9, 2024 · 2 comments · Fixed by #1608
Closed

PgVectorRM: dspy 2.5.6 does not provide the extra 'pgvector' #1607

excubo-jg opened this issue Oct 9, 2024 · 2 comments · Fixed by #1608

Comments

@excubo-jg
Copy link

import dspy
from dspy.retrieve.pgvector_rm import PgVectorRM

causes this error message when executing:

  File "/lib/python3.11/site-packages/dspy/retrieve/pgvector_rm.py", line 7, in <module>
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/c/Ubuntu/postgres.py", line 2, in <module>
    from dspy.retrieve.pgvector_rm import PgVectorRM
  File "/lib/python3.11/site-packages/dspy/retrieve/pgvector_rm.py", line 11, in <module>
    raise ImportError(
ImportError: The 'pgvector' extra is required to use PgVectorRM. Install it with pip install dspy-ai[pgvector]

Pip install fails both for dspy and dspy-ai:

pip install dspy-ai[pgvector]
Requirement already satisfied: dspy-ai[pgvector] in /home/wsl/micromamba/envs/GenQA/lib/python3.11/site-packages (2.5.3)
WARNING: dspy-ai 2.5.3 does not provide the extra 'pgvector'
pip install dspy[pgvector]
Requirement already satisfied: dspy[pgvector] in /home/wsl/micromamba/envs/GenQA/lib/python3.11/site-packages (2.5.6)
WARNING: dspy 2.5.6 does not provide the extra 'pgvector'
@okhat
Copy link
Collaborator

okhat commented Oct 9, 2024

Thanks @excubo-jg ! Was this working for your before 2.5.6? Or is it the first time you're trying this?

Could you try:

pip install pgvector psycopg2-binary

Then do your import. I think that's what it needs. We should edit the error message to ask people to install these there.

@arnavsinghvi11
Copy link
Collaborator

Hi @excubo-jg , does #1608 resolve this? turns out that dspy-ai[pgvector] was never supported!

Feel free to test on the branch and lmk if any other changes are needed (as I don't have access to pgvector related functionality to test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants