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,成功。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM