So, I know that this is not a new topic, but it that no one seems to be able to solve, at least not for Python 2.6 / Snow Leopard. (The Leopard fixes I found are not applicable to Snow Leopard.)
Situation: I am trying to install Django locally on my Mac OS X Snow Leopard laptop. (10.6.7) I have Python 2.6.1 that was preinstalled using Snow Leopard, MySQL-python 1.2.3, and MAMP 1.9.6. All latest versions of latest versions.
Without making any changes to the MySQLdb package, if I run python setup.py build , I get hundreds or more errors, the first of which:
$ python setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb running build_ext building '_mysql' extension creating build/temp.macosx-10.6-universal-2.6 gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.6-universal-2.6/_mysql.o -fno-omit-frame-pointer -g _mysql.c:36:23: error: my_config.h: No such file or directory _mysql.c:38:19: error: mysql.h: No such file or directory _mysql.c:39:26: error: mysqld_error.h: No such file or directory _mysql.c:40:20: error: errmsg.h: No such file or directory _mysql.c:76: error: expected specifier-qualifier-list before 'MYSQL' _mysql.c:90: error: expected specifier-qualifier-list before 'MYSQL_RES'
and ending with:
_mysql.c:2422: error: initializer element is not constant _mysql.c:2422: error: (near initialization for '_mysql_ResultObject_memberlist[0].offset') _mysql.c: In function '_mysql_ConnectionObject_getattr': _mysql.c:2444: error: '_mysql_ConnectionObject' has no member named 'open' lipo: can't open input file: /var/folders/Br/Br8Yhf-IGVCaGfXw4TYRc++++TI/-Tmp-//ccFnIslh.out (No such file or directory) error: command 'gcc-4.2' failed with exit status 1
So, I updated my site.cfg file with the mysql_config location:
# The path to mysql_config. # Only use this if mysql_config is not on your PATH, or you have some weird # setup that requires it. mysql_config = /Applications/MAMP/Library/bin/mysql_config
Still the same error. I spent the last two days troubleshooting, so I did a whole bunch of other things (including ez_setup , downloading .egg files and manually changing some parameters in the code), but none of them gave any different results, so I wonβt bother you all the details. In general, maybe something obvious, I went missing, who knows? (with hope). Python and MySQL work fine, so one thing that I haven't done yet and tried to avoid is reinstalling MySQL not through MAMP. But if anyone has reason to believe that this is necessary, I will try.
Any help would be greatly appreciated! Thanks.