python找不到解释器_CMake FindPython3在Windows上找不到解释器

这CMakeLists.txt是我正在使用的文件的开头:

cmake_minimum_required(VERSION3.12)project(hello-pyext)find_package(Python3COMPONENTSInterpreterDevelopment)message(STATUS"Python: version=${Python3_VERSION} interpreter=${Python3_EXECUTABLE}")if(NOTPython3_FOUNDANDPython3_Development_FOUND)# find_package() will not abort the build if anything's missing.string(JOIN"\n"errmsg" Python3 and/or development libs not found."" - Python3_FOUND=${Python3_FOUND}"" - Python3_Development_FOUND=${Python3_Development_FOUND}")message(FATAL_ERROR ${errmsg})endif()

当内置cmake-3.12.4-Linux-x86_64(从下载cmake.org)在Linux上,它工作正常,发现通过安装两个Python3解释和开发头文件/库apt-get。(系统上还安装了Python2,但我已经确认它找到的解释器是Python3。)

但是,在Windows 10上,它将找到开发标头/库,但找不到解释器,并打印:

-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.14393.

-- Could NOT find Python3 (m

你可能感兴趣的:(python找不到解释器)