I am using python 2.7 and MySQLdb, while doing import MySQLdb its throwing below error –
import MySQLdb
File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Python/2.7/site-packages/_mysql.so
Reason: image not found
You need to have the mysql client installed on your system.
If you have, then you have the file
libmysqlclient.18.dyliblocated somewhere on your system. Make sure the path where it is located is included in yourDYLD_LIBRARY_PATHenvironment variable.