[macOS] macOS Big Sur ld: library not found for -lzstd

when installing mysqlclient for python

pip3 install mysqlclient

i got these errors

lib -lmysqlclient -lzstd -lresolv -o build/lib.macosx-11-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
    ld: library not found for -lzstd
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1

Solution

brew reinstall zstd

CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip3 install mysqlclient

Have fun with python!

原文地址:https://www.cnblogs.com/davidhhuan/p/15393229.html