Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18690

Re: Error Importing MySQLdb

References <L0oOq.65165$8O1.34287@newsfe07.iad> <mailman.4532.1326061044.27778.python-list@python.org> <18369429.1936.1326062224503.JavaMail.geo-discussion-forums@vbdz6>
Date 2012-01-08 20:23 -0500
Subject Re: Error Importing MySQLdb
From Benjamin Kaplan <benjamin.kaplan@case.edu>
Newsgroups comp.lang.python
Message-ID <mailman.4537.1326072193.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Jan 8, 2012 at 5:37 PM, davidfx <dgeorge29ca@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.

"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"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Error Importing MySQLdb David George <dgeorge@daviddgeorge.com> - 2012-01-08 16:37 -0500
  Re: Error Importing MySQLdb Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-01-08 17:17 -0500
    Re: Error Importing MySQLdb davidfx <dgeorge29ca@gmail.com> - 2012-01-08 14:37 -0800
    Re: Error Importing MySQLdb davidfx <dgeorge29ca@gmail.com> - 2012-01-08 14:37 -0800
      Re: Error Importing MySQLdb Dave Angel <d@davea.name> - 2012-01-08 18:08 -0500
      Re: Error Importing MySQLdb Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-01-08 20:23 -0500
        Re: Error Importing MySQLdb John Nagle <nagle@animats.com> - 2012-01-08 21:47 -0800

csiph-web