Pandas Scikit学习Sage 7.2中的熊猫

Pandas Scikit学习Sage 7.2中的熊猫,pandas,scikit-learn,pip,osx-elcapitan,sage,Pandas,Scikit Learn,Pip,Osx Elcapitan,Sage,我正在尝试将scikit learn和pandas放入Sage 7.2(在El Capitan上)。我在Sage 6.6中成功地做到了这一点。但是,当我输入/Applications/SageMath-7.2.app/Contents/Resources/sage/sage--pip install scikit learn(与pandas的结果相同)时,我会收到以下错误消息 creating build/temp.macosx-10.9-x86_64-2.7 creating build/te

我正在尝试将scikit learn和pandas放入Sage 7.2(在El Capitan上)。我在Sage 6.6中成功地做到了这一点。但是,当我输入
/Applications/SageMath-7.2.app/Contents/Resources/sage/sage--pip install scikit learn
(与
pandas
的结果相同)时,我会收到以下错误消息

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-x86_64-2.7
创建build/temp.macosx-10.9-x86_64-2.7/sklearn
创建build/temp.macosx-10.9-x86_64-2.7/sklearn/svm
创建build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src
创建build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src/libsvm
编译选项:'-I/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.9-x8664.egg/numpy/core/include-c'
g++:sklearn/svm/src/libsvm/libsvm_template.cpp
在sklearn/svm/src/libsvm/svm.cpp:53:0中包含的文件中,
来自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:致命错误:sys/cdefs.h:没有这样的文件或目录
#包括
^
编译终止。
在sklearn/svm/src/libsvm/svm.cpp:53:0中包含的文件中,
来自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:致命错误:sys/cdefs.h:没有这样的文件或目录
#包括
^
编译终止。
错误:命令"g++-fno严格别名-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-x8664.egg/numpy/core/include-csklearn/svm/src/libsvm/libsvm_template.cpp-o build/temp.macosx-10.9-x86_64-2.7/sklearn/svm/src/libsvm/libsvm_template.o“失败,退出状态为1
----------------------------------------
命令失败,错误代码为1

我一直找不到任何方法继续。我能想到的唯一问题是安装说明参考的是
macosx-10.9
,但El Capitan是10.11。所以可能就是这个问题吧?

你的问题是注意
没有这样的文件或目录
。我建议你安装命令行工具,甚至是Xcode。你做了吗按以下顺序排列

  • 安装Sage
  • 在某个时候,升级你的Mac操作系统
  • 升级您的Sage
  • 尝试安装熊猫等
  • 如果是这样的话,可能这就是问题所在。我刚刚升级了我的Mac电脑,在它识别它之前,我不得不重新安装了两次命令行工具。幸运的是,现在这并不难——打开一个终端,尝试使用
    gcc
    或其他东西,它会提示你,尽管你的里程可能会有所不同


    那么您的命令应该可以正常工作,对我来说也可以。

    就是这样。升级到El Capitan后,我没有重新安装Xcode命令行工具。完成了,现在scikit和pandas安装正确。谢谢。