Help in v1 to v2 migrations (postgres)

Traceback (most recent call last):
File “/home/master24/snap/code/209/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/multiprocessing/process.py”, line 314, in _bootstrap
self.run()
File “/home/master24/snap/code/209/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/_subprocess.py”, line 80, in subprocess_started
target(sockets=sockets)
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/server.py”, line 67, in run
return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/_compat.py”, line 23, in asyncio_run
return runner.run(main)
^^^^^^^^^^^^^^^^
File “/home/master24/snap/code/209/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/asyncio/runners.py”, line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/master24/snap/code/209/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/asyncio/base_events.py”, line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/server.py”, line 71, in serve
await self._serve(sockets)
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/server.py”, line 78, in _serve
config.load()
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/config.py”, line 438, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/uvicorn/importer.py”, line 19, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/master24/snap/code/209/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1147, in _find_and_load_unlocked
File “”, line 690, in _load_unlocked
File “”, line 940, in exec_module
File “”, line 241, in _call_with_frames_removed
File “/home/master24/AIProject/apps/ai_agents/combined_server_new.py”, line 41, in
from agents_and_teams import creator
File “/home/master24/AIProject/apps/ai_agents/agents_and_teams/creator.py”, line 1, in
from .customer_support_agent.agent import (
File “/home/master24/AIProject/apps/ai_agents/agents_and_teams/customer_support_agent/agent.py”, line 39, in
db = PostgresDb(
^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/agno/db/postgres/postgres.py”, line 74, in init
_engine = create_engine(db_url)
^^^^^^^^^^^^^^^^^^^^^
File “”, line 2, in create_engine
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py”, line 281, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py”, line 617, in create_engine
dbapi = dbapi_meth(**dbapi_args)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg.py”, line 418, in import_dbapi
import psycopg
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/psycopg/init.py”, line 9, in
from . import pq # noqa: F401 import early to stabilize side effects
^^^^^^^^^^^^^^^^
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/psycopg/pq/init.py”, line 116, in
import_from_libpq()
File “/home/master24/AIProject/apps/ai_agents/.venv/lib/python3.11/site-packages/psycopg/pq/init.py”, line 108, in import_from_libpq
raise ImportError(
ImportError: no pq wrapper available.
Attempts made:

  • couldn’t import psycopg ‘c’ implementation: No module named ‘psycopg_c’
  • couldn’t import psycopg ‘binary’ implementation: No module named ‘psycopg_binary’
  • couldn’t import psycopg ‘python’ implementation: libpq library not found

Hey @TheMaster24, thanks for reaching out and supporting Agno.
I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon. If it’s urgent, please let us know. We appreciate your patience!

Thank you @yuvi and it’s not urgent as of now. Since i use pgsql for my other works I wanted to implement a memory system for my agents, but due to this error I broke the project. Fortunately I branched my dev branch to the last working commit.

So, it’s not urgent, but it would be better if I’m provided with any agno material that would show me how to set up a memory for agent to summarise the context on each run efficiently.

Thanks and regards,
Kavi

hey @TheMaster24 could you please try pip install ‘psycopg[binary]’ . let me know if if works.