2014-04-09 5 views
8

Ich habe versucht, Python-Paket scikit-lernen zu installieren. Ich bekomme immer einen Fehler.Probleme der Installation von Scikit-lernen in Python

Ich versuchte

pip install scikit­-learn 

Der Fehler wie folgt aussieht. Was ist das Problem meiner Installation?

compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c' 

c++: sklearn/svm/src/libsvm/libsvm_template.cpp 

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] 

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future 

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] 

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future 

error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c sklearn/svm/src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.9-intel-2.7/sklearn/svm/src/libsvm/libsvm_template.o" failed with exit status 1 

---------------------------------------- 
Cleaning up... 
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/scikit-learn/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-GYuqQN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/scikit-learn 
Storing debug log for failure in /Users/johnkuk/Library/Logs/pip.log 

Ich habe auch verschiedene Möglichkeiten versucht, das Paket zu installieren. Von easy_install habe ich folgende Fehlermeldung erhalten.

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] 
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future 
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] 
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future 
error: Setup script exited with error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c /private/tmp/easy_install-oD3dwa/scikit-learn-0.14.1/sklearn/svm/src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.9-intel-2.7/private/tmp/easy_install-oD3dwa/scikit-learn-0.14.1/sklearn/svm/src/libsvm/libsvm_template.o" failed with exit status 1 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/distutils/misc_util.py:252: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import 
    from numpy.distutils import log 
+0

Das sieht wie ein Problem mit Ihrer LLVM-Installation aus. Sind Sie sicher, dass Sie die neueste Version der XCode CLI-Tools haben? – inspectorG4dget

+0

scikit-learn nimmt seine Compiler-Argumente von NumPy und es sieht so aus, als wäre Ihr NumPy mit GCC kompiliert worden, also müssen Sie damit kompilieren. –

Antwort

6

Ich hatte das gleiche Problem heute, nach mir viele Dinge, die eine, die arbeitete versuchen vor der Installation mit pip Umgebungsvariablen einstellt das Problem für mich gelöst:

export CFLAGS=-Qunused-arguments 
export CPPFLAGS=-Qunused-arguments 

Und dann mit sudo installieren :

sudo -E pip install -U scikit-learn 

es scheint ein Problem mit Xcode-Update (5.1.1 für mich) zu sein, ist es -mno-verschmolzenen madd 'als Argument nicht akzeptiert, bevor er eine Warnung warf, weiß, ist, ein Fehler, Die ersten beiden Befehle ignorieren die unbenutzten Argumente, die die gleichen sind, die den Fehler werfen.

Hoffe es hilft, Kommentare/Korrekturen sind willkommen.

+2

Arbeitete auch für mich, Mavericks laufen – themaestro

Verwandte Themen