Installing mysqlclient
Python module on macOS Mojave requires mysql-client
and SSL
library to be available on the host.
Following steps can be performed to achieve this:
- Install
openssl
usingbrew install openssl
- The above step should result in the
openssl
libraries to be placed in/usr/local/opt/openssl/lib/
. You need to add that path toLIBRARY_PATH
.export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
- Install
mysql-client
usingbrew install mysql-client
This should place themysql-client
binaries under/usr/local/Cellar/mysql-client/
- Add location of
mysql-client
to thePATH
. For example,export PATH=/usr/local/Cellar/mysql-client/8.0.18/bin:$PATH
- Install
mysqlclient
in your virtualenv usingpip install mysqlclient