Building Against NumPy
Finding numpy.get_include() in setup.py, numpy in build-system.requires of pyproject.toml, dependency('numpy') in meson.build, or cimport statements in .pyx or .pyd files are a telltale sign that the package links against NumPy.
Adding numpy in the host: section is sufficient to have a compatible NumPy version at run time:
- v0 (meta.yaml)
- v1 (recipe.yaml)
requirements:
host:
- numpy
requirements:
host:
- numpy
At the time of writing (June 2025), the above is equivalent to the following:
- v0 (meta.yaml)
- v1 (recipe.yaml)
requirements:
host:
- numpy 2.*
requirements:
host:
- numpy 2.*
See the pinning repository for what the pinning corresponds to at any given time.
In either case, the actual runtime requirements are determined through numpy's run-export, which is:
>=1.2x,<2if you're building against numpy 1.2x>=1.19,<3if you're building against numpy 2.0>=1.21,<3if you're building against numpy 2.1 or 2.2>=1.23,<3if you're building against numpy 2.3
If the package you are building has a higher minimum requirement for numpy, please add this under run:
- v0 (meta.yaml)
- v1 (recipe.yaml)
requirements:
host:
# leave this unpinned!
- numpy
run:
- numpy >={{ the_lower_bound_your_package_needs }}
requirements:
host:
# leave this unpinned!
- numpy
run:
- numpy >=${{ the_lower_bound_your_package_needs }}