Error Importing MySQLdb

Benjamin Kaplan benjamin.kaplan at
Sun Jan 8 20:23:09 EST 2012

On Sun, Jan 8, 2012 at 5:37 PM, davidfx <dgeorge29ca at> wrote:
> I am not sure what file you mean.  Where should I look for the file you are talking about?  By the way MySQL works fine within MAMP.
> Thanks for your suggestions.

Like I said, it's likely an architecture issue. If you have a 32-bit
MySQL install and are using a 64-bit Python, it won't be able to load
the client libraries. The Python install included in Lion is universal
(a single file containing both 32-bit and 64-bit executables) so if
it's loaded by a 32-bit program, it will load in 32-bit mode.

"file" is a command that uses heuristics to determine the type of a
file. You run it from a terminal.

$ file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture i386):	Mach-O executable i386

Try running "file /usr/local/lib/libmysqlclient.18.dylib". According
to the traceback you posted, that's the library that failed to load.

If you need to force Python to run in 32-bit mode, you can use the arch command
"arch -i386 python"

More information about the Python-list mailing list