fatal error: numpy/arrayobject.h

1,622 views
Skip to first unread message

Prodromos Alampritis

unread,
Feb 22, 2018, 10:21:03 AM2/22/18
to Caffe Users
Hello all,

So i got this weird issue when i run tests and make all for caffe. The reason that this is weird, is because that when i do python import numpy i can see it there (version 1.14).

Checked the path in the Makefile.config and apparently the numpy in the /usr/include/numpy is broken (red with black brackground)

i cheked where the path is to the numpy/arrayobject.h and is under a virtual environment path under the caffe directory. In here => caffe/venv/lib/python2.7/site-packages/numpy/core/include/numpy

which it should be the same with out the venv there. Any thoughts?

Would unistalling and reinstalling numpy will work, or doing that will mess it up?

Prod



[1]+  Done                    make all
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
Makefile:507: recipe for target 'python/caffe/_caffe.so' failed
make: *** [python/caffe/_caffe.so] Error 1

lee.s...@gmail.com

unread,
Feb 22, 2018, 11:49:15 AM2/22/18
to Caffe Users
You have to add the path that contains numpy/arrayobject.h into Makefile.config

For example, mine is at location /usr/local/lib/python2.7/dist-packages/numpy/core/include

Hence, my PYTHON_INCLUDE in Makefile.config looks like

PYTHON_INCLUDE := /usr/include/python2.7 \
                                  /usr/local/lib/python2.7/dist-packages/numpy/core/include

Then run
make pytest

Prodromos Alampritis

unread,
Mar 3, 2018, 8:03:11 AM3/3/18
to Caffe Users

Exactly what i have but still throws an error.....
Reply all
Reply to author
Forward
0 new messages