This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / get_include

function

numpy:get_include

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/lib/_utils_impl.py :80

Signature

def   get_include ( )

Summary

Return the directory that contains the NumPy *.h header files.

Extended Summary

Extension modules that need to compile against NumPy may need to use this function to locate the appropriate include directory.

Notes

When using setuptools, for example in setup.py

import numpy as np
...
Extension('extension_name', ...
          include_dirs=[np.get_include()])
...

Note that a CLI tool numpy-config was introduced in NumPy 2.0, using that is likely preferred for build systems other than setuptools

$ numpy-config --cflags
-I/path/to/site-packages/numpy/_core/include

# Or rely on pkg-config:
$ export PKG_CONFIG_PATH=$(numpy-config --pkgconfigdir)
$ pkg-config --cflags
-I/path/to/site-packages/numpy/_core/include

Examples

np.get_include()

Aliases

  • numpy.get_include