MacOS: fatal error: 'numpy/arrayobject.h' file not found Solution

Error

 fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
         ^
1 error generated.
error: command 'clang' failed with exit status 1

Solution

Before doing python setup.py install set the CFLAGS value to the following value:

export CFLAGS="-I /usr/local/lib/python2.7/site-packages/numpy/core/include $CFLAGS"

Then re-execute

python setup.py install

CFLAGS will tell gcc where the "numpy/arrayobject.h" is located.