Fixed this.

Steps:

— Uninstalled the psycopg2 and psycopg2-binary

— Repaired all Microsoft Virtual Studio (C compilers)

— Restarted windows. 

— Installed the latest psycopg (3.**)

— Changed database URL string to use only psycopg instead of psycopg2

— working fine now