2016-06-20 81 views
1

我試圖把scikit學習和熊貓放入聖人7.2(在埃爾卡皮坦)。我在Sage 6.6中成功完成了這個任務。但是,當我輸入/Applications/SageMath-7.2.app/Contents/Resources/sage/sage --pip install scikit-learnpandas的結果相同)時,我收到以下錯誤消息。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。所以也許這就是問題所在?

回答

2

你的問題是筆記No such file or directory。我建議你安裝命令行工具,甚至是Xcode。你是否按照以下順序做事情?

  1. 安裝賢者
  2. 在某些時候,升級您的Mac OS
  3. 升級你的賢者
  4. 嘗試安裝熊貓等

如果是這樣,可能這就是問題所在。我剛剛升級了我的Mac,並且必須重新安裝命令行工具兩次才能識別它。幸運的是,現在這不是很難 - 打開終端並嘗試使用gcc或其他東西,它應該提示你,雖然你的里程可能會有所不同。

然後你的命令應該可以正常工作,它適用於我。

+1

就是這樣。升級到El Capitan後,我沒有重新安裝Xcode命令行工具。做到了,現在scikit和大熊貓安裝得當。謝謝。 –