Пробовал:
- brew reinstall openssl
- pip install psycopg2-binary instead of pip install psycopg2.
И работает.
python
Python 2.7.16 (default, Dec 3 2019, 07:02:07)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> conn = psycopg2.connect(host="localhost",database="postgres", user="appadmin", password="pass1")
>>> cur = conn.cursor()
>>> print('PostgreSQL database version:')
PostgreSQL database version:
>>> cur.execute('SELECT version()')
>>> db_version = cur.fetchone()
>>> print(db_version)
('PostgreSQL 10.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.9.3, 64-bit',)
>>> cur.close()