繁体   English   中英

在macOS Sierra Python 2.7上安装mysqlclient时出错

[英]Error while installing mysqlclient on macOS Sierra Python 2.7

我正在尝试安装mysqlclient:

pip install mysqlclient

我收到此错误:

/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g -I/usr/local/opt/lzlib/include -L/usr/local/opt/lzlib/lib -I/usr/local/opt/openssl/include build/temp.macosx-10.6-intel-2.7/_mysql.o -L/usr/local/mariadb/server/lib -lmariadb -lzlib -lpthread -ldl -lm -liconv -lgnutls -lnettle -ltasn1 -lgmp -lhogweed -o build/lib.macosx-10.6-intel-2.7/_mysql.so
ld: library not found for -lzlib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1

我已经用brew安装了库:

brew install lzlib

但是错误仍然存​​在。

开发工具也已安装:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

mysql_config中有如下几行:

# Create options 
libs="-L$pkglibdir"
libs="$libs -l"

它应该是:

# Create options 
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM