OSX ld: library not found for -lssl

I had the same issue after upgrading to osx Mojave, and on python 3.7.2. This is what worked for me:

# Required for mysqlclient, see brew info openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

pip3 install mysqlclient

Hope it helps. For more see here.

Leave a Comment