python system_error ai_generated true

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

ID: python/pip-wheel-building-failure

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2024-02-14First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active

Root Cause

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

generic

中文

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

Workarounds

  1. 90% success 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% success 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`

Dead Ends

Common approaches that don't work:

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

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

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

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