Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think there might be slight quirks with doing this on Mac 64-bit (and if you google this problem shows up a lot too).</p> <p>I've run into it, and there are a couple things you can do:</p> <h3>Override the environment</h3> <p>You can change the <code>DYLD_LIBRARY_PATH</code> environment variable, which tells the linker where to look for dynamic libraries (.so files and such). You said you also downloaded the 64-bit version of MySQL, so where ever it's installed, change the path you see here:</p> <p>In a shell: </p> <p><code>export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/</code></p> <p>And then run <code>python</code> and see if you can <code>import MySQLdb</code>.</p> <p>If that works, you can make this permanent by altering your shell profile (<code>.bash_profile</code>, most likely).</p> <h3>Use homebrew</h3> <p>I don't really like mucking around with making sure MySQL and Python and all that are correct architectures and installing them separately. I run <a href="http://mxcl.github.com/homebrew/" rel="noreferrer"><code>homebrew</code></a>, which is a sort of package manager for Mac. If you install that, you can pretty easily take care of this issue:</p> <ul> <li><code>brew install python</code></li> <li><code>brew install mysql</code></li> <li><code>/usr/local/share/python/easy_install mysql-python</code></li> </ul> <p>Do note that homebrew installs into <code>/usr/local</code>, so you should add <code>/usr/local/bin</code> to your <code>PATH</code>, ahead of <code>/usr/bin</code> and <code>/bin</code>, otherwise you'll get really confused why <code>python</code> is different.</p> <p>You can add <code>/usr/local/share/python</code> to your <code>PATH</code> as well, to make it permanent.</p>
 

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