Note that there are some explanatory texts on larger screens.

plurals
  1. POPython import MySQLdb error - Mac 10.6
    primarykey
    data
    text
    <p>I downloaded and followed the install instructions for MySQL 5.5.8 (<a href="http://dev.mysql.com/downloads/mysql/" rel="nofollow noreferrer">http://dev.mysql.com/downloads/mysql/</a>) and for the MySQLdb python plugin. (<a href="http://sourceforge.net/projects/mysql-python/" rel="nofollow noreferrer">http://sourceforge.net/projects/mysql-python/</a>)</p> <p>When I attempt to import MySQLdb to a python terminal, I get the below error:</p> <pre><code>Safira:~ yanigisawa$ python --version Python 2.6.1 Safira:~ yanigisawa$ python -c "import MySQLdb" Traceback (most recent call last): File "&lt;string&gt;", line 1, in &lt;module&gt; File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in &lt;module&gt; File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in &lt;module&gt; File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib Referenced from: /Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so Reason: image not found Safira:~ yanigisawa$ </code></pre> <p>I found question <a href="https://stackoverflow.com/questions/4559699/">4559699</a> on stack overflow, and followed the instructions there:</p> <pre><code>Safira:~ yanigisawa$ echo $DYLD_LIBRARY_PATH /usr/local/mysql/lib Safira:~ yanigisawa$ ls -l /usr/local/mysql/lib total 363224 -rwxr-xr-x 1 root wheel 3787328 Jan 18 19:41 libmysqlclient.16.dylib -rw-r--r-- 1 root wheel 10035336 Dec 3 13:26 libmysqlclient.a lrwxr-xr-x 1 root wheel 23 Jan 14 22:01 libmysqlclient.dylib -&gt; libmysqlclient.16.dylib lrwxr-xr-x 1 root wheel 20 Jan 14 22:01 libmysqlclient_r.16.dylib -&gt; libmysqlclient.dylib lrwxr-xr-x 1 root wheel 16 Jan 14 22:01 libmysqlclient_r.a -&gt; libmysqlclient.a lrwxr-xr-x 1 root wheel 20 Jan 14 22:01 libmysqlclient_r.dylib -&gt; libmysqlclient.dylib -rw-r--r-- 1 root wheel 88033760 Dec 3 13:22 libmysqld-debug.a -rw-r--r-- 1 root wheel 84075304 Dec 3 13:26 libmysqld.a -rw-r--r-- 1 root wheel 8472 Dec 3 13:26 libmysqlservices.a drwxr-xr-x 13 root wheel 442 Dec 3 13:53 plugin Safira:~ yanigisawa$ md5 /usr/local/mysql/lib/libmysqlclient.16.dylib MD5 (/usr/local/mysql/lib/libmysqlclient.16.dylib) = b8a78a93183720021b9dbe9ddad57111 Safira:~ yanigisawa$ </code></pre> <p>And after cleaning all of the python egg files, and rebuilding, I still got the same error. Then I found bug 59006 (<a href="http://bugs.mysql.com/bug.php?id=59006" rel="nofollow noreferrer">http://bugs.mysql.com/bug.php?id=59006</a>) in MySQL 5.5.8 affecting Mac 10.6. I tried the work-around listed there, cleaned eggs and rebuilt, and I'm still getting this error. </p> <p>Is there another work-around for this problem specific to python? Am I missing something else?</p> <p><strong>EDIT</strong>: Adding output from otool commands:</p> <pre><code>Safira:~ yanigisawa$ otool -L /Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so /Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so: libmysqlclient.16.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1) Safira:~ yanigisawa$ otool -DX /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib Safira:~ yanigisawa$ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload