2014-09-23 5 views
8

Ich wollte meine django app von sqlite zu mysql portieren.mysql-python auf mac osx 10.9.2: fehler: befehl '/ usr/bin/clang' fehlgeschlagen mit exit status 1

Aber wenn ich versuche, MySQL-Python zu installieren, es gibt mir diese Fehlermeldung: Fehler: Befehl ‚/ usr/bin/Klirren‘ ist fehlgeschlagen mit Exit-Status 1

Ich sah mich um nach Hinweisen und versuchte,

sudo su export CFLAGS = -Qunused Argumente Export CPPFLAGS = -Qunused-Argumente pip installiert MySQL-python

Das komplette Fehlerprotokoll ist hier: diese Lösung, die für die meisten Menschen gearbeitet zu haben schien:

pip install MySQL-python 
Downloading/unpacking MySQL-python 
    Running setup.py egg_info for package MySQL-python 

Installing collected packages: MySQL-python 
    Running setup.py install for MySQL-python 
    building '_mysql' extension 
    /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -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-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64 
    xcrun: error: active developer path ("/Users/deeptichopra/Desktop/Applications and Softwares/Xcode.app/Contents/Developer") does not exist, use xcode-select to change 
    error: command '/usr/bin/clang' failed with exit status 1 
    Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y71a30-record/install-record.txt --single-version-externally-managed: 
    running install 

running build 

running build_py 

copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb 

running build_ext 

building '_mysql' extension 

/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -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-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64 

xcrun: error: active developer path ("/Users/deeptichopra/Desktop/Applications and Softwares/Xcode.app/Contents/Developer") does not exist, use xcode-select to change 

error: command '/usr/bin/clang' failed with exit status 1 

---------------------------------------- 
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y71a30-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/MySQL-python 
Storing complete log in /var/root/.pip/pip.log 

Hier ist /var/root/.pip/pip.log:

Downloading/unpacking MySQL-python 

    Running setup.py egg_info for package MySQL-python 

    running egg_info 
    writing pip-egg-info/MySQL_python.egg-info/PKG-INFO 
    writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt 
    writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt 
    warning: manifest_maker: standard file '-c' not found 


    reading manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt' 
    reading manifest template 'MANIFEST.in' 
    writing manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt' 
    Source in /tmp/pip-build/MySQL-python has version 1.2.5, which satisfies requirement MySQL-python 
Installing collected packages: MySQL-python 

    Running setup.py install for MySQL-python 

    Running command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build//var/root/.pip/pip.log 
+0

Können Sie '/ var/root/.pip/pip.log' bitte hochladen? :) –

+0

Ich habe pip.log zur Frage hinzugefügt. – dvc

Antwort

23

Ich weiß, dass dies ein wenig auf die Frage spät ist, aber für diejenigen, die später kommen, ich glaube, das liegt daran, dass Sie keine xcode- oder xcode-Tools installiert haben. Sobald Sie xcode haben, können Sie xcode Werkzeuge mit installieren:

xcode-select --install 
+1

Ich kam viel später und das war die Lösung. Sehr geschätzt! – Amir