我最近升级到Mac OS莫哈韦现在还不能安装MySQL的Python:
pip install MySQL-Python
...
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-2.7/_mysql.o -L/usr/local/opt/mysql-client/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-x86_64-2.7/_mysql.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
堆栈跟踪说,“SSL”未找到库。我不知道这意味着什么,虽然我有最新的Xcode和安装OpenSSL的。任何意见赞赏。
我曾在MacOS 10.14相同的问题,我可以用这些措施来解决它:
对于/usr/local
到allow Homebrew to create links更改权限:
sudo chown -R $(whoami) $(brew --prefix)/*
现在重新安装OpenSSL的是权限已得到修复:
brew reinstall openssl
运行这两个命令,让编译器发现的OpenSSL:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
然后,再次尝试安装MySQL的Python:
pip install MySQL-Python
对于在/ usr /本地允许自制创建链接更改权限:
sudo chown -R $(whoami) $(brew --prefix)/*
现在重新安装OpenSSL的是权限已得到修复:
brew reinstall openssl
运行这两个命令,让编译器发现的OpenSSL:
export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"
然后,再次尝试安装MySQL的Python:
pip install MySQL-Python
它的工作原理为Mac 10.14.2与python2.7 / Django的1.9.8和MySQL服务器8与MySQL-客户为例;