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