python system_error ai_generated true

错误:为 mypackage 构建 wheel 失败 错误:命令 'cmake' 失败:没有那个文件或目录

ERROR: Failed building wheel for mypackage error: command 'cmake' failed: No such file or directory

ID: python/pip-wheel-building-failure

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2024-02-14首次发现

版本兼容性

版本状态引入弃用备注
3.8 active
3.9 active
3.10 active

根因分析

该包需要构建工具(如 cmake),但系统上未安装。

English

The package requires a build tool (like cmake) that is not installed on the system.

generic

解决方案

  1. 90% 成功率 Install cmake and ensure it is in PATH
    On Ubuntu: `sudo apt-get install cmake`. On macOS: `brew install cmake`. Verify with `cmake --version`.
  2. 75% 成功率 Use a pre-built wheel from PyPI or a third-party index
    `pip install --only-binary=:all: mypackage` or download a .whl file and install with `pip install mypackage.whl`

无效尝试

常见但无效的做法:

  1. Installing cmake but not adding it to PATH 50% 失败

    pip cannot find the cmake executable if it's not in PATH.

  2. Using --no-build-isolation to use system-installed cmake 80% 失败

    If cmake is not installed at all, this flag does not help.