编辑 MySQLdb Python 中使用的 C 编译器 [英] Edit C Compiler used in MySQLdb Python

查看:34
本文介绍了编辑 MySQLdb Python 中使用的 C 编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Mac OSX Lion 10.7.3 上安装 MySQLdb 1.2.3.当我跑

I am trying to install MySQLdb 1.2.3 on Mac OSX Lion 10.7.3. When I run

$ sudo ARCHFLAGS="-arch x86_64" python setup.py build

$ sudo ARCHFLAGS="-arch x86_64" python setup.py build

抛出一个错误说:

 gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk
    -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -                I/usr/local/mysql/include -  I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-x86_64-2.7/_mysql.o -Os -g -fno-common -fno-strict-aliasing -arch i386
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1

我看到了这个类似的论坛帖子但注意到MySQLdb 1.2.3 不包含 user_config.py.

I saw this similar forum post but noticed that MySQLdb 1.2.3 does not include a user_config.py.

我的问题是,我可以编辑哪个 .py 文件以将gcc-4.2"更改为gcc"?这可能会解决问题.

My question is, which .py file can I edit to change 'gcc-4.2' to 'gcc'? This could likely fix the problem.

推荐答案

嗯.

CC=gcc python setup.py ...

这篇关于编辑 MySQLdb Python 中使用的 C 编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆