安装python MySQLdb时出现MacOS X错误

安装python MySQLdb时出现MacOS X错误,python,mysql,Python,Mysql,我试图在我的mac电脑上安装python mysqldb,但出现以下错误。对于mysql,我使用的是与MAMP捆绑在一起的。谢谢 以下是错误消息: running build running build_py copying MySQLdb/release.py -> build/lib.darwin-8.11.1-i386-2.3/MySQLdb running build_ext building '_mysql' extension gcc -fno-strict-aliasing

我试图在我的mac电脑上安装python mysqldb,但出现以下错误。对于mysql,我使用的是与MAMP捆绑在一起的。谢谢

以下是错误消息:

running build
running build_py
copying MySQLdb/release.py -> build/lib.darwin-8.11.1-i386-2.3/MySQLdb
running build_ext
building '_mysql' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c _mysql.c -o build/temp.darwin-8.11.1-i386-2.3/_mysql.o
_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: parse error before 'MYSQL'
_mysql.c:76: warning: no semicolon at end of struct or union
_mysql.c:79: error: parse error before '}' token
_mysql.c:79: warning: type defaults to 'int' in declaration of '_mysql_ConnectionObject'
_mysql.c:79: warning: data definition has no type or storage class

..

我想仅仅使用与MAMP捆绑的MySQL是不够的,因为它不包含MySQL的C开发工具(即头文件,如
MySQL.h
)。这是一个关于在MacOSX上编译Python的MySQL扩展的分步教程,但是看起来您需要“官方”的MySQL发行版