Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scikit-learn install failure / numpy not found / missing numpy headers

When i try to install scikit-learn on a Suse (openSuse 12.2 x86_64) server via:

pip install -U scikit-learn

i get the following error:

(....)

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.

I already tried:

-installing gcc to the latest version
-installing scikit from a downloaded zip, over easy_install (to avoid old repos) -uninstalling and reinstalling numpy (over pip)

When i try to install scipy (which is a requirement of numpy) i get a similar Error:

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

Apparently all the numpy headers in "site-packages/numpy/core/include" are missing. I already reinstalled numpy with pip without any Problems but the headers are still missing.

like image 386
Dev Icro Avatar asked Aug 20 '13 11:08

Dev Icro


1 Answers

Ok when i installed numpy with pip or normally all the include header were missing.

To fix this i installed the package "python-numpy-devel" (with zypper, stupid suse package names...) which contains the headers.

After that the headers are there and the rest works.

like image 138
Dev Icro Avatar answered Oct 08 '22 15:10

Dev Icro