I am using CMake
to find Python3
, and my CMakeLists.txt
is:
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS})
link_libraries(${Python3_LIBRARIES})
After configure, a bug is reported:
CMake Error at D:/Program Files/CMake/share/cmake-3.22/Modules/FindPython/Support.cmake:1832 (list):
list index: 10 out of range (-10, 9)
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.22/Modules/FindPython3.cmake:490 (include)
CMakeLists.txt:2 (find_package)
My environment is:
win 10
vs2022 x64
Python 3.7.0
Anaconda
How to fix this bug? Any suggestion is appreciated~~~
Update:
_Python3_INTERPRETER_PROPERTIES:INTERNAL=Python;3;10;5;64;;cp310-win_amd64;D:\Python-3.10.5\Lib;D:\Python-3.10.5\Lib;D:\Python-3.10.5\Lib\site-packages;D:\Python-3.10.5\Lib\site-packages