【问题标题】:Running CMAKE couldn't find python executable运行 CMAKE 找不到 python 可执行文件
【发布时间】:2020-09-27 12:14:30
【问题描述】:

github 中提出的问题的链接:github issue link for reference

应用版本:CURA 3.6 版本

平台:

  • 处理器:Intel(R) Core(TM) i5-8300H CPU @ 2.30 GHz
  • 内存:16.0 GB
  • 系统类型:64 位操作系统,基于 x64 的处理器

复制步骤

我正在尝试从https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Windows#microsoft-visual-studio-2019 运行源代码。 并尝试运行第 10 步。 10:

打开 CMake 并将其源目录指向您的 cura-build 存储库,并将构建目录指向构建子目录。

实际结果

D:\work\cura-build-master\cura-build-master\build>cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/MicrosoftVisualStudio14.0/VC/bin/amd64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/MicrosoftVisualStudio14.0/VC/bin/amd64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPython/Support.cmake:2966 (find_package_handle_standard_args)
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPython3.cmake:389 (include)
CMakeLists.txt:94 (find_package)

-- Configuring incomplete, errors occurred!
See also "D:/work/cura-build-master/cura-build-master/build/CMakeFiles/CMakeOutput.log".

预期结果

CMake 应该在 build 目录中生成所有文件。

从上述错误可以看出,CMake 无法找到 python 可执行文件。

我没有在系统上安装 python。唯一可用的 python 来自 CURA(在构建 cura-build-environment 时安装)。如何链接或使CMake找到已安装的python可执行文件?

就我而言,它已安装/在此文件夹中找到可执行文件: \cura-build-environment-master\install_dir\bin

【问题讨论】:

  • Stack Overflow 上有很多关于提示 CMake 关于 python 可执行文件的问题。你检查过它们吗?您是否尝试过that question 的答案中的建议? (例如that answer 建议将-DPYTHON_EXECUTABLE:FILEPATH=/path/to/python 参数传递给cmake)。

标签: python cmake exe


【解决方案1】:

查了一下发现可以设置python可执行文件:

对于窗户: 设置(Python3_EXECUTABLE D:/cura-build-environment-master/install_dir/bin/python.exe)

【讨论】:

    猜你喜欢
    • 2023-01-10
    • 1970-01-01
    • 2014-06-27
    • 2018-08-10
    • 2013-11-13
    • 2021-11-30
    • 2017-06-17
    • 2023-03-29
    • 2017-07-03
    相关资源
    最近更新 更多