pip install mysqlclient error

I just had the same problem and only got a partial working solution. Here are the steps I made to make it work:

  • brew install mysql-client
  • brew install mysql-connector-c

IF YOU HAVE ZSH:

  • echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
  • source ~/.zshrc

ELSE:

  • echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
  • source ~/.bash_profile

Now for the installation itself:

  • LDFLAGS=-L< your openssl lib folder location > pip install mysqlclient==<  version  >

for exampleLDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient==1.3.12

Share