mac下安装mysql-python包报unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1解决方法

今天试着安装mysql-python包,刚开始是报“clang”failed with exit status 1,我执行以下命令:

export CC=llvm-gcc-4.2

结果报unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1错误,愤怒,执行which gcc,无反应,结果找到,是gcc未安装的原因,两个解决方法:

1、直接下载gcc安装上

2、从http://stackoverflow.com/questions/8473066/gcc-4-2-failed-with-exit-status-1找到解决方法,xcode属性-下载-components-command line tools,完成后重试which gcc,输出/usr/bin/gcc,

执行:

python setup.py clean

python setup.py build

python setup.py install,安装成功,测试:import MySQLdb,成功。

 

你可能感兴趣的:(Directory)