在雪豹上安装MySQLdb [英] Installing MySQLdb on Snow Leopard

查看:102
本文介绍了在雪豹上安装MySQLdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循本教程,在我的Snow Lepard上安装具有MySQL的Django:
http://programmingzen.com/2007/12/22/how-to-install-django-with-mysql-on-mac-os-x /

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/

当我运行这个命令:

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

有人可以帮助

谢谢: - )

推荐答案

看起来你缺少MySQL开发头。苹果的支持网站有一个(可能的)解决方案: http://support.apple.com/kb/TA25017

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

这篇关于在雪豹上安装MySQLdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆