I faced the same issue on macOS and solved it by running below steps:
-
Uninstall psycopg2:
pip uninstall psycopg2
-
Re-install psycopg2:
pip install psycopg2-binary
I faced the same issue on macOS and solved it by running below steps:
Uninstall psycopg2: pip uninstall psycopg2
Re-install psycopg2: pip install psycopg2-binary