I'm having all sorts of trouble trying to instal MySQLdb (1.2.2) on snow leopard. I am running python 2.5.1 and MySQL 5.1 32bit.
Python and MySQL are running just fine.
I've also installed django 1.2.1, although I don't think thats all that important, but wanted to give an idea of the stack i'm trying to install. I am using python 2.5.x as my webhost only has that version as an option and I want to be as close to my production env as possible.
anyway...
After following many of the existing articles and tutorials which mention modifying _mysql.c and setup_posix.py etc, I am still running into trouble.
Here is my stack trace:
xxxxxxx-mbp:MySQL-python-1.2.2 xxxxxxx$ sudo ARCHFLAGS="-arch x86_64" python setup.py build running build running build_py creating build creating build/lib.macosx-10.3-i386-2.5 copying _mysql_exceptions.py -> build/lib.macosx-10.3-i386-2.5 creating build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/init.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/converters.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/connections.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/cursors.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb copying MySQLdb/times.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb creating build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/init.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-i386-2.5/MySQLdb/constants running build_ext building '_mysql' extension creating build/temp.macosx-10.3-i386-2.5 gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql-5.1.48-osx10.6-x86/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3-i386-2.5/_mysql.o -g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL In file included from /Developer/SDKs/MacOSX10.4u.sdk/usr/include/wchar.h:112, from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/unicodeobject.h:118, from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:83, from pymemcompat.h:10, from _mysql.c:29: /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory In file included from _mysql.c:35: /usr/local/mysql-5.1.48-osx10.6-x86/include/my_config.h:1062:1: warning: "HAVE_WCSCOLL" redefined In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8, from pymemcompat.h:10, from _mysql.c:29: /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:724:1: warning: this is the location of the previous definition error: command 'gcc' failed with exit status 1
Does anyone have any ideas?
sudo port install mysql5-server-devel python25 py25-mysql
. It will tell you how to set up your new MySQL server at the end of the installation. You'll also need to make sure you're using the MacPorts Python installation instead of your system one (you can use python-select for that). – Aram Dulyan