0

I took the following steps after reading suggestions from http://andhikalegawa.wordpress.com/2012/01/05/installing-mysql-python-on-snow-leopard-using-xampp-mysql/

  1. Downloaded MySQL-python-1.2.4b4 and unzipped
  2. Changed the mysql_config = /Applications/XAMPP/xamppfiles/bin/mysql_config (as I am using XAMPP 1.7.3)
  3. Downloaded mysql-5.1.70-osx10.6-x86 (I could not find 5.1.55 which is the version used in XAMPP) kept the include folder at /Applications/XAMPP/xamppfiles/
  4. I am new to development so, downloaded XCode 4.6.3 with command line tools.

Logically it should have worked I am getting the following error

running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb running build_ext building '_mysql' extension creating build/temp.macosx-10.7-intel-2.7 llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'beta',4) -D_version_=1.2.4b4 -I/Applications/XAMPP/xamppfiles/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-intel-2.7/_mysql.o -mmacosx-version-min=10.4 -arch i386 -arch ppc -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL In file included from _mysql.c:44: /Applications/XAMPP/xamppfiles/include/my_config.h:1088:1: warning: "HAVE_WCSCOLL" redefined In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8, from _mysql.c:29: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:891:1: warning: this is the location of the previous definition llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory lipo: can't figure out the architecture type of: /var/folders/6p/8bxdl12d2nq05dmwbmdzttt40000gn/T//cc0v0ehE.out error: command 'llvm-gcc-4.2' failed with exit status 255

Mukul
  • 1

1 Answers1

0

Looks like it's trying to compile universal for PowerPC, which you probably don't have?

error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2'

I would suggest setting the ARCHFLAGS:

shell> rm -Rf build/
shell> ARCHFLAGS="-arch i386" /usr/bin/python setup.py build

Or instead of i386, on 64-bit x86_64. But since you are downloading 32-bit MySQL, might be good to use i386.

Good luck! (Shameless advert: you can always try MySQL Connector/Python)

geertjanvdk
  • 3,440
  • 24
  • 26