python - cc1 : error: unrecognized command line option "-Wno-null-conversion" within installing python-mysql on mac 10. 7.5

标签 python mysql macos python-2.7 mysql-python

这个错误破坏了我在 Mac 10.7.5 上的 python-mysql 安装。以下是步骤

  1. 安装的python是2.7.1,mysql是5.6.11的64位。
  2. 正在安装的python-mysql是1.2.4,也试过1.2.3
  3. 安装配置

    1) sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
    2) Edit the setup_posix.py and change the following mysql_config.path = "mysql_config" to mysql_config.path = "/usr/local/mysql/bin/mysql_config" 
    3) sudo python setup.py build
    

这是构建的堆栈跟踪

running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-intel-2.7/_mysql.o -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
cc1: error: unrecognized command line option "-Wno-null-conversion"
error: command 'llvm-gcc-4.2' failed with exit status 1

欢迎您的建议和想法。谢谢。

最佳答案

尝试删除

中的cflags -Wno-null-conversion -Wno-unused-private-field
/usr/local/mysql/bin/mysql_config.

喜欢:

cflags="-I$pkgincludedir  -Wall   -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!

关于python - cc1 : error: unrecognized command line option "-Wno-null-conversion" within installing python-mysql on mac 10. 7.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16127493/

相关文章:

mysql - 使用 Docker-Compose 连接到 MariaDB 时出错, "Connection Lost: The server closed the connection"

swift - NSMakeRect 跟踪 slider Swift 3

python - 如何获取电路中的 POST 数据 (Python)?

python - 存储空间数组 SQLite3

mysql - 获取具有最新生效日期的行

python - pyobjc-core 安装期间出现 xcode-select 错误

ios - 并发文件枚举

python - 如何从 python 在命令行中运行程序

python - 如何创建一个组合嵌套在元组中的列表值的索引?

python - 无法在 python virtualenv 中安装 mysqlclient