Open
Description
When I use postgresql
scheme, I hit this error:
File "/usr/src/Python/rag-agent/src/Infrastructure/VectorStore.py", line 87, in __init__
self.vector_store = PGVector(
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
embeddings = self._embeddings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
async_mode = True
^^^^^^^^^^^^^^^^^
)
^
File "/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/langchain_postgres/vectorstores.py", line 434, in __init__
self._async_engine = create_async_engine(
~~~~~~~~~~~~~~~~~~~^
connection, **(engine_args or {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/sqlalchemy/ext/asyncio/engine.py", line 120, in create_async_engine
sync_engine = _create_engine(url, **kw)
File "<string>", line 2, in create_engine
File "/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
File "/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/sqlalchemy/engine/create.py", line 602, in create_engine
dbapi = dbapi_meth(**dbapi_args)
File "/home/khteh/.local/share/virtualenvs/rag-agent-YeW3dxEa/lib/python3.13/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 696, in import_dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
(1) Why psycopg2
instead of psycopg3
(https://www.psycopg.org/psycopg3/docs/basic/install.html)?
(2) Does it actually need SQLAlchemy URLs since it is PG
Vector? Why not directly using the postgresql
scheme?
Metadata
Metadata
Assignees
Labels
No labels