MacOS X安装python MySQLdb时出错

时间:2010-06-22 06:18:09

标签: 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 -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

...

1 个答案:

答案 0 :(得分:3)

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

相关问题