【问题标题】:MySQL header files not found MySQL-python db未找到 MySQL 头文件 MySQL-python db
【发布时间】:2012-09-05 01:43:30
【问题描述】:

今天我一直试图让 Django 在我的 MAC OS Lion 上运行一段时间,但没有成功。我的 MAC 上预装了 Python 2.7.1。我将 MySQL 安装为 XAMPP 附带的软件包。我已经安装了 Django 1.4.1。

我继续通过 python 在终端中导入 django 并确认 django 已成功安装,一切都很好 - 没有错误。

每当我尝试在 MySQL-python-1.2.3 中构建和安装 setup.py 文件时,就会出现问题。当我这样做时:

sudo python setup.py build

在 MySQL-python-1.2.3 目录中,我得到错误:

RE_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: expected specifier-qualifier-list before ‘MYSQL’

(以及更多错误)... (以...结尾)

llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-            llvm-gcc-4.2': execvp: No such file or directory

lipo:无法打开输入文件:/var/tmp//ccShAtAs.out(没有这样的文件或目录) 错误:命令“llvm-gcc-4.2”失败,退出状态为 255**

此外,当我尝试这样做时遇到相同的错误时:

sudo python setup.py install

【问题讨论】:

  • 你安装mysqldb了吗?它是mysql的python接口。

标签: mysql django macos


【解决方案1】:

MySQL-Python 需要 MySQL C 头文件才能构建,但它们似乎不包含在 XAMPP 默认安装中。 The internet suggests you install the XAMPP development package.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-28
    • 1970-01-01
    • 2016-01-29
    • 1970-01-01
    • 2020-04-27
    相关资源
    最近更新 更多