0

I followed this tutorial to install Django with MySQL on my Snow Lepard : http://programmingzen.com/2007/12/22/how-to-install-django-with-mysql-on-mac-os-x/

When I run this command :

python setup.py build

I get a lot of errors, the last one is :

error: command 'gcc-4.0' failed with exit status 1

These are the first lines that I get after executing the command line

running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.5-fat3-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch ppc -arch x86_64 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include/mysql -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-fat3-2.7/_mysql.o -fno-omit-frame-pointer -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
_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: syntax error before ‘MYSQL’
_mysql.c:76: warning: no semicolon at end of struct or union
_mysql.c:79: error: syntax error before ‘}’ token

Can somebody help me to fix that ?

Thank you :-)

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
bnabilos
  • 2,234
  • 4
  • 23
  • 30
  • The other errors are much more relevant than the final error, probably starting with the first error you see, since `gcc-4.0` is a valid terminal command. – philosodad Oct 25 '10 at 02:31
  • Can you post the other errors too? – Chetan Oct 25 '10 at 02:32
  • Hello, I added the first lines. Thank you – bnabilos Oct 25 '10 at 02:38
  • Are you running Snow Leopard or Leopard? These are not the same. Snow Leopard will not run on a PPC machine, and the build script is expecting a PPC machine. Also, are you running MAMP? This will have it's own issues. – philosodad Oct 25 '10 at 02:45
  • I'm running Snow Leopard and I have also MAMP installed – bnabilos Oct 25 '10 at 11:09
  • That partially explains why the script you were running wasn't working: it was built for Leopard. If the answer below doesn't work, you might try http://wiki.chrisgilmer.net/index.php?. – philosodad Oct 26 '10 at 03:57
  • Possible duplicate of http://stackoverflow.com/questions/1904039/django-mysql-on-mac-os-10-6-2-snow-leopard – Srikar Appalaraju Oct 25 '10 at 02:56

1 Answers1

0

Looks like you're missing MySQL development headers. Apple's support site has a (possible) solution: http://support.apple.com/kb/TA25017

David Wolever
  • 148,955
  • 89
  • 346
  • 502