Trouble building MySQLdb-python load command 7 cmd unknown

29 views
Skip to first unread message

MikeM329

unread,
Jul 27, 2008, 5:32:52 PM7/27/08
to Django users, brianr...@gmail.com
I have spent the last day and a half googling and reading every blog
post on the topic of installing the MySQLdb-python for use with
django. At this point i have not found a solution for my challenge.

I am installing django for development purposes on my MacBook Pro
I successfully installed django and it seems to run just fine until i
want to use it with MySQL
I have MySQL version mysql-5.0.51b-osx10.5-x86
I'm trying to add MySQL-python-1.2.2.tar.gz
when i try to do the build using the command: python setup.py build
I get the following output:

running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -
bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/
_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/
lib.macosx-10.3-i386-2.5/_mysql.so
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: for architecture ppc
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning build/
temp.macosx-10.3-i386-2.5/_mysql.o cputype (7, architecture i386) does
not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning /usr/local/
mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does
not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: for architecture i386
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/local/mysql/lib/
libmysqlclient_r.dylib load command 7 unknown cmd field
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/1D/1DIYDOE7GQ0pbcmmuCcESE++
+TI/-Tmp-//ccHh0Glq.out (No such file or directory)
error: command 'gcc' failed with exit status 1

Because my machine has an intel processor i believe i can ignore the
warnings about the ppc architecture and that the crux of my troubles
stem from the line that says"

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/local/mysql/lib/
libmysqlclient_r.dylib load command 7 unknown cmd field
collect2: ld returned 1 exit status

I have scoured many blogs and haven't found anyone with the same issue
or a solution. Thanks in advance for any advice you can give.

MikeM329

unread,
Jul 28, 2008, 1:35:25 PM7/28/08
to Django users
Since this post yesterday i have now tried using a different version
of MySQL (mysql-5.1.26-rc-osx10.5-x86), which did not work either.

Karen Tracey

unread,
Jul 28, 2008, 8:46:33 PM7/28/08
to django...@googlegroups.com
On Mon, Jul 28, 2008 at 1:35 PM, MikeM329 <Jonathan....@gmail.com> wrote:

Since this post yesterday i have now tried using a different version
of MySQL (mysql-5.1.26-rc-osx10.5-x86), which did not work either.

 
Sorry, I don't have any Macs so cannot help with the build problem.  I can't help wondering,
though, if there is not a binary packaging of MySQLdb available somewhere for your platform?  Surely not everyone who runs on a Mac builds MySQLdb from source?

Karen

Hellika

unread,
Jul 29, 2008, 2:14:28 AM7/29/08
to Django users
The problem is to do with the term uint. Mac is expecting unsigned..
so go into _mysql.c and change them and try again..


i recomend cleaning first..

$sudo python setup.py clean

then go here and follow instructions http://www.keningle.com/?p=11

Cheers

On Jul 28, 6:32 am, MikeM329 <Jonathan.J.Osbo...@gmail.com> wrote:
> I have spent the last day and a half googling and reading every blog
> post on the topic of installing the MySQLdb-pythonfor use with
> django.  At this point i have not found a solution for my challenge.
>
> I am installing django for development purposes on my MacBook Pro
> I successfully installed django and it seems to run just fine until i
> want to use it withMySQL
> I haveMySQLversionmysql-5.0.51b-osx10.5-x86
> I'm trying to addMySQL-python-1.2.2.tar.gz
> when i try to do the build using the command:pythonsetup.py build
> I get the following output:
>
> running build
> running build_py
> copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb
> running build_ext
> building '_mysql' extension
> gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -
> bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/
> _mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/
> lib.macosx-10.3-i386-2.5/_mysql.so
> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: for architecture ppc
> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning build/
> temp.macosx-10.3-i386-2.5/_mysql.o cputype (7, architecture i386) does
> not match cputype (18) for specified -arch flag: ppc (file not loaded)
> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning /usr/local/mysql/lib/libmysqlclient_r.dylib cputype (7, architecture i386) does

Hellika

unread,
Jul 29, 2008, 2:17:13 AM7/29/08
to Django users
I think i screwed the first post up..

clean you build and then go here http://www.keningle.com/?p=11 and
try ;)

Cheers

MikeM329

unread,
Aug 4, 2008, 7:27:55 PM8/4/08
to Django users
I solved the problem.

My version of xcode was 2.5 and i needed to upgrade to version 3.1.

Once i upgraded to xcode version 3.1 i then followed the instructions
@ http://www.kenigle.com/?p=11
and everything worked perfectly.

Thanks Hellika for your help!

Joshua Jonah

unread,
Aug 4, 2008, 9:37:37 PM8/4/08
to django...@googlegroups.com
In the future, just Fink it.
Reply all
Reply to author
Forward
0 new messages