无法在Mac os x Mojave上安装mysqlClient [英] can't install mysqlclient on mac os x mojave
本文介绍了无法在Mac os x Mojave上安装mysqlClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Mac os x Mojave上安装mysqlClient:
sudo pip3 install mysqlclient
我收到以下错误:
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 -I/usr/local/Cellar/mysql/8.0.12/include/mysql -I/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.13-x86_64-3.6/_mysql.o
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.6/_mysql.o -L/usr/local/Cellar/mysql/8.0.12/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-x86_64-3.6/_mysql.cpython-36m-darwin.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
----------------------------------------
Command "/Users//Development/apps/hid_ve/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-1mo7e_ok/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-9bwluwz6/install-record.txt --single-version-externally-managed --compile --install-headers /Users//Development/apps/hid_ve/bin/../include/site/python3.6/mysqlclient" failed with error code 1 in /private/tmp/pip-install-1mo7e_ok/mysqlclient/
推荐答案
升级到Mojave后,我收到了与您相同的错误。经过一番挖掘后,以下步骤会有所帮助:
brew info openssl
该输出非常有用。如果您使用的是bash或zsh,则消息为:
要让编译器查找OpenSSL,您可能需要设置:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
执行上述命令后,一切恢复正常。😁
此外,如果您使用的是鱼。消息是:
要让编译器查找OpenSSL,您可能需要设置:
set -gx LDFLAGS "-L/usr/local/opt/openssl/lib"
set -gx CPPFLAGS "-I/usr/local/opt/openssl/include"
这篇关于无法在Mac os x Mojave上安装mysqlClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文