Skip to content

Instantly share code, notes, and snippets.

@bsodhi
Last active February 22, 2020 16:00
Show Gist options
  • Save bsodhi/22b1f17c9ce87e6e68f2365bb85c18b4 to your computer and use it in GitHub Desktop.
Save bsodhi/22b1f17c9ce87e6e68f2365bb85c18b4 to your computer and use it in GitHub Desktop.
Installing mysqlclient on macOS Mojave

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:

  1. Install openssl using brew install openssl
  2. The above step should result in the openssl libraries to be placed in /usr/local/opt/openssl/lib/. You need to add that path to LIBRARY_PATH. export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
  3. Install mysql-client using brew install mysql-client This should place the mysql-client binaries under /usr/local/Cellar/mysql-client/
  4. Add location of mysql-client to the PATH. For example, export PATH=/usr/local/Cellar/mysql-client/8.0.18/bin:$PATH
  5. Install mysqlclient in your virtualenv using pip install mysqlclient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment