ARTICLE AD BOX
I have the following pyproject.toml
[build-system] requires = ["scikit-build-core>=0.11", "pybind11>=3.0", "numpy>=2.0"] build-backend = "scikit_build_core.build" [project] name = "myproject" version = "0.0.1" description="A minimal project package." dependencies = ["numpy>=2.0"] [tool.scikit-build.cmake.define] CMAKE_POSITION_INDEPENDENT_CODE = "ON"When I build and install:
(.venv) pipx run build (.venv) pip install .I can import the library in a script, but I get the following message:
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2.The questions is: Why if I specify the Numpy>=2.0 in the pyproject.toml file, the program seems to be building with a Numpy 1.x version?
Edit 1 :
In fact, when installing I get:
Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy>=2.1.1 in ./.venv/lib/python3.10/site-packages