【问题标题】:MacOS X Error when installing python MySQLdb安装 python MySQLdb 时出现 MacOS X 错误
【发布时间】:2011-03-06 15:57:04
【问题描述】:

我正在尝试在我的 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

....

【问题讨论】:

    标签: python mysql


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-09-17
      • 2013-07-26
      • 2011-06-30
      • 1970-01-01
      • 2011-10-09
      • 1970-01-01
      • 2019-01-18
      • 2021-01-27
      相关资源
      最近更新 更多