问题:
在MAC下安装oursql模块,一直提示library not found for -lssl
错误信息如下:
cc -bundle -undefined dynamic_lookup -arch i386
-arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/oursqlx/oursql.o
build/temp.macosx-10.12-intel-2.7/oursqlx/compat.o -o
build/lib.macosx-10.12-intel-2.7/oursql.so
-L/usr/local/Cellar/mysql/5.7.18_1/lib -lmysqlclient -lssl -lcrypto
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
解决:
说明去/usr/local/Cellar/mysql/5.7.18_1/lib 该目录寻找openssl库,这个目录下并没有这个库
其实在/usr/local/opt/openssl/lib/下是有openssl库文件的,只需要把这个路径链接上就行了
所以执行下面的命令安装即可:
sudo env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install oursql