Error Importing MySQLdb

John Nagle nagle at animats.com
Mon Jan 9 00:47:07 EST 2012


On 1/8/2012 5:23 PM, Benjamin Kaplan wrote:
> On Sun, Jan 8, 2012 at 5:37 PM, davidfx<dgeorge29ca at gmail.com>  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.

     Actually, the issue is only whether you have 64-bit MySQL client 
libraries for C to which MySQLdb can link.  Those are called
"MySQL Connector/C", and here are the download pages for them.

http://dev.mysql.com/downloads/connector/c/

The actual database can (and usually should be) the 64-bit executable, 
while the libraries can be 32 or 64 bit. They communicate over a socket,
and don't even need to be on the same machine.

Unfortunately, the whole MySQLdb/Python/Connector/C versioning
setup is a mess.  See:

	http://chaos.weblogs.us/archives/327

				John Nagle



More information about the Python-list mailing list