1
我試圖把scikit學習和熊貓放入聖人7.2(在埃爾卡皮坦)。我在Sage 6.6中成功完成了這個任務。但是,當我輸入/Applications/SageMath-7.2.app/Contents/Resources/sage/sage --pip install scikit-learn
(pandas
的結果相同)時,我收到以下錯誤消息。Scikit學習和熊貓鼠尾草7.2
creating build/temp.macosx-10.9-x86_64-2.7
creating build/temp.macosx-10.9-x86_64-2.7/sklearn
creating build/temp.macosx-10.9-x86_64-2.7/sklearn/svm
creating build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src
creating build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src/libsvm
compile options: '-I/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.9-x86_64.egg/numpy/core/include -c'
g++: sklearn/svm/src/libsvm/libsvm_template.cpp
In file included from sklearn/svm/src/libsvm/svm.cpp:53:0,
from sklearn/svm/src/libsvm/libsvm_template.cpp:6:
/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.4.0/4.9.3/include-fixed/math.h:45:23: fatal error: sys/cdefs.h: No such file or directory
#include <sys/cdefs.h>
^
compilation terminated.
In file included from sklearn/svm/src/libsvm/svm.cpp:53:0,
from sklearn/svm/src/libsvm/libsvm_template.cpp:6:
/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.4.0/4.9.3/include-fixed/math.h:45:23: fatal error: sys/cdefs.h: No such file or directory
#include <sys/cdefs.h>
^
compilation terminated.
error: Command "g++ -fno-strict-aliasing -I/Applications/SageMath-7.2.app/Contents/Resources/sage/local/var/tmp/sage/build/python2-2.7.10.p1/include -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.9-x86_64.egg/numpy/core/include -c sklearn/svm/src/libsvm/libsvm_template.cpp -o build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src/libsvm/libsvm_template.o" failed with exit status 1
----------------------------------------
Command failed with error code 1
我一直無法找到任何處理方法。我能想到的唯一問題是安裝說明參考macosx-10.9
,但El Capitan是10.11。所以也許這就是問題所在?
就是這樣。升級到El Capitan後,我沒有重新安裝Xcode命令行工具。做到了,現在scikit和大熊貓安裝得當。謝謝。 –