Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing mysql-python: library not found for -lssl

I'm having trouble installing mysql-python. Created a new virtualenv and when installing mysql-python... here's the error message:

(env)$ pip install mysql-python Collecting mysql-python ...  clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk build/temp.macosx-10.12-x86_64-2.7/_mysql.o -L/usr /local/Cellar/mysql/5.7.16/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-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 

Using homebrew, I have installed:

Already tried to brew link but brew refuses to do so.

The OS is MacOS Sierra.

Can anyone help? Thanks!

like image 589
danielcorreia Avatar asked Nov 14 '16 11:11

danielcorreia


1 Answers

You can set ssl library path explicitly.

LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient 
like image 135
Hoseung Kim Avatar answered Oct 15 '22 01:10

Hoseung Kim