当我尝试通过以下方式在Suse(openSuse 12.2 x86_64)服务器上安装scikit-learn时:
pip install -U scikit-learn
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
(....)
compile options: '-I/usr/lib64/python2.7/site-packages/numpy/core/include -Isklearn/svm/src/libsvm -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c'
gcc: sklearn/svm/libsvm.c
sklearn/svm/libsvm.c:303:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
sklearn/svm/libsvm.c:303:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
我已经尝试过:
- 将gcc安装到最新版本 -
从下载的zip安装scikit,通过easy_install(以避免旧的回购) - 卸载并重新安装numpy(over pip)
当我尝试安装scipy(这是一个numpy的要求)我得到一个类似的错误:
adding 'build/src.linux-x86_64-2.7/fortranobject.c' to sources.
adding 'build/src.linux-x86_64-2.7' to include_dirs.
error: file '/usr/lib64/python2.7/site-packages/numpy/f2py/src/fortranobject.c' does not exist
Run Code Online (Sandbox Code Playgroud)
显然,"site-packages/numpy/core/include"中的所有numpy标题都丢失了.我已经重新安装numpy与pip没有任何问题,但标题仍然缺失.