【发布时间】:2019-04-06 06:11:14
【问题描述】:
我正在尝试在 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('\r\n', '\n');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/
【问题讨论】:
-
更重要的是,您似乎没有可用的 SSL 库。我不使用 macOS,所以我不知道如何在那里安装它们。
-
@Chris 我正在使用虚拟环境。我也安装了 lssl。
-
@Chris:在
macOS中,权限默认设置为这种方式。如果不使用sudo,那么您可能需要设置一个wheel用户才能在没有它的情况下安装东西。 -
请避免创建错误的标签:Mac OSX 已在两年多前重命名为 macOS。
标签: python macos mysql-python mysql-connector macos-mojave