Does anyone know how to fix this import error? I am working on macOS Monterey version 12.0.1.
from psycopg2._psycopg import (# noqa
ImportError: dlopen(/Users/myname/data-env/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_PQbackendPID'
Update: The error is pointing at "import psycopg2" in my code, and then to "from psycopg2._psycopg import" in /Users/myname/data-env/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
from psycopg2._psycopg import
does not make sense. Is this something you are doing or is coming from some code you are working with? What happens if you do:import psycopg2
? Add answers as update to question. – Juleimport psycopg2
– Atrice