To include C extensions, the setup.py to build my repo looks like:
import numpy as np
from setuptools import setup, Extension
setup(
ext_modules=[
Extension("my_module",
sources=["my_module.cc"],
include_dirs=[np.get_include()]),
],
)
but despite including the path to the numpy headers, running python setup.py install results in the error fatal error: 'arrayobject.h' file not found because my_module.cc has #include <arrayobject.h>.
I've gone through dozens of related SO and GitHub issues, all suggesting the include_dirs=[np.get_include()] workaround I've already implemented. The numpy path is /usr/local/lib/python2.7/site-packages/numpy/core/include/, and yes I've confirmed the headers are indeed there.
Any suggestions?