python import MySQLdb
<p>in python, import MySQLdb</p>

<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.10-intel.egg/MySQLdb/__init__.py", line 19, in &lt;module&gt;
    import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.10-intel.egg/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient.18.dylib
  Referenced from: /Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.10-intel.egg/_mysql.so
  Reason: image not found
</code></pre>

<p>I try <code>ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib</code> and other soultions but nothing help.</p>

<p>My computer is OS X EI Capitan, python2.7.9 django1.8.2 mysql-5-7-15</p>

<p>I'm using ubuntu 16.04 and I don't have that lib in the same place as you specified. </p>

<p>The best solution for me was installing the mysql pip package with the <code>--no-binary</code> option as shown in this <a href="http://stackoverflow.com/a/36835229/3086572">post reply</a></p>

python mysql django