Skip to content

CMake cannot found Python Development.Module for Android with Python 3.14 (3.13 works fine) #2611

@XuehaiPan

Description

@XuehaiPan

Description

I'm trying to build wheels in GitHub Action for Android with Python 3.14 (newly supported by cibuildhwheel 3.2). The CMake program fails to find Python modules with cp314-android while cp313-android works fine.

The CMake error log (see https://github.com/metaopt/optree/actions/runs/18182914758/job/51772310290?pr=242):

  CMake Error at /tmp/cibw-run-e6ejroha/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/cmake/data/share/cmake-4.1/Modules/FindPackageHandleStandardArgs.cmake:227 (message):
    Could NOT find Python (missing: Development.Module) (found suitable version
    "3.14.0", minimum required is "3.8")
  
        Reason given by package: 
            Development: Cannot find the directory "/tmp/cibw-run-e6ejroha/cp314-android_arm64_v8a/venv/include/python3.14"

  Call Stack (most recent call first):
    /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.31/Modules/FindPython/Support.cmake:4002 (find_package_handle_standard_args)
    /usr/local/share/cmake-3.31/Modules/FindPython.cmake:631 (include)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11NewTools.cmake:54 (find_package)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11Common.cmake:204 (include)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11Config.cmake:257 (include)
    CMakeLists.txt:261 (find_package)

Note that I have tried both CMake 3.31 in the build container and the latest CMake 4.x from PyPI. Either is failed with the above error.

Build log

https://github.com/metaopt/optree/actions/runs/18182914758/job/51772310290?pr=242

CI config

https://github.com/metaopt/optree/pull/242/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R210-R212

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions