NumPy include directory command not working
Describe the bug
../skimage/meson.build:58:17: ERROR: Command /usr/bin/python -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())' failed with status 1.
To Reproduce
# NumPy include directory
incdir_numpy = meson.get_external_property('numpy-include-dir', 'not-given')
if incdir_numpy == 'not-given'
# If not specified, try to query NumPy from the build python
incdir_numpy = run_command(py3,
[
'-c',
'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
],
check: true
).stdout().strip()
endif
Expected behavior manually entering import os; os.chdir(".."); import numpy; print(numpy.get_include()) into a Python shell delivers /usr/lib/python3.10/site-packages/numpy/core/include
system parameters
- ArchLinux-derivative
- Python 3.10
- meson "1.4.99" (git build > 1.4.0)
- ninja 1.11.1
Are you invoking the build with pip from your local repo? If so, try using "pip install --no-build-isolation ."
@waarmond, I faced the same issue. Solved it by adding numpy to the requirements section in my pyproject.toml.
[build-system]
requires = [
'meson-python',
'numpy>=2.0.0'
]
build-backend = 'mesonpy'
This can be closed I think, seems to be a build config issue rather than a problem in scikit-image or meson.