I've tried common solutions written for mysqlclient error
brew install mysql-connector-c
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
brew install zstd
And mysql server is well-running. But the error is not being fixed..
I am getting clang linker error
saying library not found for -lzstd
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/user/.asdf/installs/python/3.7.10/lib -L/usr/local/opt/llvm/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/user/.asdf/installs/python/3.7.10/lib -L/usr/local/opt/llvm/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -L/usr/local/opt/llvm/lib -I/usr/local/opt/llvm/include build/temp.macosx-11.2-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql/8.0.25_1/lib -lmysqlclient -lzstd -lresolv -o build/lib.macosx-11.2-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
ld: library not found for -lzstd
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs.
You use pip to install it directly: pip install mysqlclient. Note that you don't need this to try Django; nor do you need Apache. Python and Django is already an "integrated development environment" since Python includes sqlite3, and Django includes a development server.
In my case I did not had the sudo access so installed brew for my user Check if your brew is not in default location do this to check where you have installed brew
brew --prefix
output: Users/helloWorld/homebrew
use the output of above to set the ld flags and cpp flags for example for me ssl and zstd libs were not found so this is what i did:
export LDFLAGS="-L/Users/helloWorld/homebrew/lib -L/Users/helloWorld/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/Users/helloWorld/homebrew/include -I/Users/helloWorld/homebrew/opt/openssl/include"
and then do the pip install
pip3 install mysqlclient
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With