4

I've been looking around for a solution to this, and there seem to be a lot of different solutions, but none seem to be working.

I'm using MySQL-Python to try to get MySQL set up with python. But, when I try to run

sudo python setup.py build

I get the following error:

Password:
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/mysql-5.5.21-osx10.6-x86/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch i386
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
             from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from _mysql.c:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config.h:329:1: warning: "SIZEOF_SIZE_T" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:9,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:1: warning: this is the location of the previous definition
In file included from _mysql.c:36:
/usr/local/mysql-5.5.21-osx10.6-x86/include/my_config.h:422:1: warning: "HAVE_WCSCOLL" redefined
In file included from     /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8,
             from pymemcompat.h:10,
             from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:887:1: warning: this is the location of the previous definition
error: command 'gcc-4.2' failed with exit status 1
4
  • 1
    "a lot of different solutions, but none seem to be working". Please be specific. What ones have you tried? What happened? Commented Feb 26, 2012 at 0:10
  • stackoverflow.com/questions/8473066/…, Same error followed Commented Feb 26, 2012 at 17:02
  • Also justcramer.com/2007/11/05/mysqldb-on-leopard, but I didn't even find the lines they were talking about, and the error didn't seem to be exactly the same Commented Feb 26, 2012 at 17:05
  • @S.Lott all the other solutions seem to be variations on those two Commented Feb 26, 2012 at 17:31

1 Answer 1

1

I had the same problem. After a few hours of struggling, I've used ActivePython (http://code.activestate.com/pypm/mysql-python/) successfully to install MySQL-python. Although it doesn't exactly solve your error, it solves the overall issue :)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Yeah, I just ended up using SQLite temporarily, but I figured this is just one of those times when you have to try to install something different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.