“Failed building wheel for psycopg2” – MacOSX using virtualenv and pip

For MacOS users

After trying all the above methods (which did not work for me on MacOS 10.14), that one worked :

  • Install openssl with brew install openssl if you don’t have it already.
  • add openssl path to LIBRARY_PATH :
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
  • install psycopg2 with pip pip3 install psycopg2

Leave a Comment