У меня есть следующий 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"
Когда я собираю и устанавливаю:
(.venv) pipx run build
(.venv) pip install .
Я могу импортировать библиотеку в скрипт, но получаю следующее сообщение:
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
Подробнее здесь: https://stackoverflow.com/questions/798 ... rong-versi