Are you sure you're Postgres is running on port 5432? Try 5433.
https://github.com/psycopg/psycopg2/issues/1634#issuecomment-1837451754