Caffe: fatal error: numpy/arrayobject.h: No such file or directory ; when 'make pycaffe' command given

Created on 31 Aug 2014  ·  3Comments  ·  Source: BVLC/caffe

I followed all the installation steps for setting up caffe , for deep learning. But the compilation stops with at this stage

`/usr/bin/g++-4.6 -shared -o python/caffe/_caffe.so python/caffe/_caffe.cpp \
build/lib/libcaffe.a -pthread -fPIC -DNDEBUG -O2 -I/usr/local/in
clude/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/u
sr/local/include -Ibuild/src -I./src -I./include -I/usr/local/cuda/include -L/us
r/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/cuda/lib64 -L/usr/local/cud
a/lib -lcudart -lcublas -lcurand -lpthread -lglog -lprotobuf -lleveldb -lsnappy
-lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc
-lcblas -latlas -lboost_python -lpython2.7

python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or
directory
compilation terminated.
make: *** [python/caffe/_caffe.so] Error 1`

Most helpful comment

sudo apt-get install python-numpy

i think it will solve that problem.. best of luck

All 3 comments

It seems that you don't have numpy installed or you installed it for a different version of python. Check that the following lines run without errors. After that ensure to use it the correct path of python/numpy headers and library in the Makefile.config file.

$ python
>>> import numpy

It is possible that this kind of problems should be posted on the user mailing-list first.

Please continue this installation discussion on the caffe-users mailing list. Thanks for answering and suggesting the mailing list @escorciav.

sudo apt-get install python-numpy

i think it will solve that problem.. best of luck

Was this page helpful?
0 / 5 - 0 ratings