Make distutils look for numpy header files in the correct place

Use numpy.get_include():

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np                           # <---- New line

ext_modules = [Extension("hello", ["hello.pyx"],
                                  include_dirs=[get_numpy_include()])]   # <---- New argument

setup(
  name="Hello world app",
  cmdclass = {'build_ext': build_ext},       
  ext_modules = ext_modules
)

Leave a Comment