scikit-build / cmake-python-distributions

This project provides the infrastructure to build CMake Python wheels.
https://cmake-python-distributions.readthedocs.io
Apache License 2.0
112 stars 34 forks source link

Cannot build wheels for cmake #468

Closed Amane-Fujimiya closed 5 months ago

Amane-Fujimiya commented 5 months ago

I am having this error while installing cmake.

Collecting cmake
  Using cached cmake-3.28.4.tar.gz (42 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: cmake
  Building wheel for cmake (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cmake (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      C:\Users\Admin\AppData\Local\Temp\pip-build-env-rbivo8p6\overlay\lib\python3.11\site-packages\setuptools_scm\git.py:308: UserWarning: git archive did not support describe output
        warnings.warn("git archive did not support describe output")
      C:\Users\Admin\AppData\Local\Temp\pip-build-env-rbivo8p6\overlay\lib\python3.11\site-packages\setuptools_scm\git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
        warnings.warn("unprocessed git archival found (no export subst applied)")
      Traceback (most recent call last):
        File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-rbivo8p6\overlay\lib\python3.11\site-packages\skbuild\setuptools_wrap.py", line 645, in setup
          cmkr = cmaker.CMaker(cmake_executable)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-rbivo8p6\overlay\lib\python3.11\site-packages\skbuild\cmaker.py", line 148, in __init__
          self.cmake_version = get_cmake_version(self.cmake_executable)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-rbivo8p6\overlay\lib\python3.11\site-packages\skbuild\cmaker.py", line 105, in get_cmake_version
          raise SKBuildError(msg) from err

          =============================DEBUG ASSISTANCE=============================
          If you are seeing a compilation error please try the following steps to
          successfully install cmake:
          1) Upgrade to the latest pip and try again. This will fix errors for most
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) If running on Raspberry Pi OS, you can set PIP_ONLY_BINARY=cmake in
             order to retrieve the latest wheels built by piwheels.
             c.f. https://github.com/scikit-build/cmake-python-distributions/issues/392#issuecomment-1676284749
          3) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
             order to retrieve the last manylinux1 compatible wheel.
          4) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
             requirements in order to retrieve the last manylinux1 compatible wheel.
          5) Open an issue with the debug information that follows at
             https://github.com/scikit-build/cmake-python-distributions/issues

          Python: 3.11.7
          platform: Windows-10-10.0.22631-SP0
          machine: AMD64
          bits: 64
          pip: n/a
          setuptools: 69.2.0
          scikit-build: 0.17.6
          PEP517_BUILD_BACKEND=setuptools.build_meta
          =============================DEBUG ASSISTANCE=============================

      Problem with the CMake installation, aborting build. CMake executable is cmake
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cmake
Failed to build cmake
ERROR: Could not build wheels for cmake, which is required to install pyproject.toml-based projects

Tried this multiple time and it remains the same. Anyone know what is going on?

henryiii commented 5 months ago

We've got binaries for Windows 32-bit, 64-bit, and ARM: https://pypi.org/project/cmake/#files. How are you installing? Are you forcing builds from source somehow?

(Also, it says it's using the SDist from your cache, I wonder if anything would change if you cleared the cache)

Amane-Fujimiya commented 5 months ago

We've got binaries for Windows 32-bit, 64-bit, and ARM: https://pypi.org/project/cmake/#files. How are you installing? Are you forcing builds from source somehow?

(Also, it says it's using the SDist from your cache, I wonder if anything would change if you cleared the cache)

I did tried to SDist cache, but to no success. But then I found out that this is because of version conflict instead. Somehow, MSYS2 installation had a deprecated version of Python install, of which conflicts with this version, so I deleted the deprecated Python install then try to reinstall cmake, and it worked.

I really appreciate for the help too, because I did force it to build from source. After using the binaries, the system gave me hints about version conflict, so it was resolved.