Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 00ca8f4

Browse files
committed
numpy.distutils is removed in numpy 1.26 on Python 3.12.
so we don't use numpy.distutils to get includes dirs of python-numpy
1 parent 9bd14d5 commit 00ca8f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/OpenCVDetectPython.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ if(NOT ${found})
216216
message(STATUS " PYTHON3_NUMPY_INCLUDE_DIRS")
217217
else()
218218
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
219-
execute_process(COMMAND "${_executable}" -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))"
219+
execute_process(COMMAND "${_executable}" -c "import numpy; print(numpy.get_include())"
220220
RESULT_VARIABLE _numpy_process
221221
OUTPUT_VARIABLE _numpy_include_dirs
222222
OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)