Skip to content

pip: install errors on termux (Android) #7424

@AbhiTheModder

Description

@AbhiTheModder

On Termux(Android) installation through pip (pip install z3-solver) during dependency build, forcefully tries to install custom cmake version(3.30.4) via pip which breaks installation of z3-solver even though cmake is already installed in environment.

Termux Info:

~ $ termux-info
Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=30314
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture: 
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.44.1
Android version:
14
Kernel build information:
Linux localhost 5.10.198-android12-9-g39ee4e8303c8 #1 SMP PREEMPT Wed Jul 24 14:19:31 UTC 2024 aarch64 Android 
Device manufacturer:
Xiaomi
Device model:
23076RN4BI
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.styling versionCode:1000

cmake info:

~ $ cmake --version
cmake version 3.30.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

ERROR LOG:

~ $ pip install -v z3-solver
Running command pip subprocess to install build dependencies
Using pip 24.2 from /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip (python 3.12)
Collecting setuptools>=70
Obtaining dependency information for setuptools>=70 from https://files.pythonhosted.org/packages/31/2d/90165d51ecd38f9a02c6832198c13a4e48652485e2ccf863ebb942c531b6/setuptools-75.2.0-py3-none-any.whl.metadata
Using cached setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
Collecting cmake
Downloading cmake-3.30.4.tar.gz (31 kB) # here
Installing build dependencies: started
Running command pip subprocess to install build dependencies
Using pip 24.2 from /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip (python 3.12)
Collecting scikit-build-core
Obtaining dependency information for scikit-build-core from https://files.pythonhosted.org/packages/88/fe/90476c4f6a1b2f922efa00d26e876dd40c7279e28ec18f08f0851ad21ba6/scikit_build_core-0.10.7-py3-none-any.whl.metadata
Downloading scikit_build_core-0.10.7-py3-none-any.whl.metadata (21 kB)
Collecting packaging>=21.3 (from scikit-build-core)
Obtaining dependency information for packaging>=21.3 from https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl.metadata
Downloading packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
    Collecting pathspec>=0.10.1 (from scikit-build-core)
      Obtaining dependency information for pathspec>=0.10.1 from https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl.metadata
      Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
    Downloading scikit_build_core-0.10.7-py3-none-any.whl (165 kB)
    Downloading packaging-24.1-py3-none-any.whl (53 kB)
    Downloading pathspec-0.12.1-py3-none-any.whl (31 kB)
    Installing collected packages: pathspec, packaging, scikit-build-core
    Successfully installed packaging-24.1 pathspec-0.12.1 scikit-build-core-0.10.7
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Running command Getting requirements to build wheel
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Running command Preparing metadata (pyproject.toml)
    *** scikit-build-core 0.10.7 using CMake 3.30.5 (metadata_wheel)
    Preparing metadata (pyproject.toml): finished with status 'done'
  Using cached setuptools-75.2.0-py3-none-any.whl (1.2 MB)
  Building wheels for collected packages: cmake
    Building wheel for cmake (pyproject.toml): started
    Running command Building wheel for cmake (pyproject.toml)
    *** scikit-build-core 0.10.7 using CMake 3.30.5 (wheel)
    *** Configuring CMake...
    loading initial cache file build/py3-none-linux_aarch64/CMakeInit.txt
    -- The CXX compiler identification is Clang 19.1.2
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- ***************************************************
    -- Build CMake from source: ON
    -- ***************************************************
    -- SuperBuild - CMakeProject-src-download
    -- SuperBuild - CMakeProject-src-download - URL: https://github.com/Kitware/CMake/releases/download/v3.30.4/cmake-3.30.4.tar.gz
    -- SuperBuild - CMakeProject-src-download - CMakeProject_SOURCE_DIR: /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/CMake-src
    -- Looking for __GLIBC__
    -- Looking for __GLIBC__ - not found
    -- Looking for __GLIBC_MINOR__
    -- Looking for __GLIBC_MINOR__ - not found
    -- SuperBuild -   CMakeProject-build
    -- SuperBuild -   CMakeProject-build - CMakeProject_BINARY_DIR: /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build
    -- SuperBuild -   CMakePythonDistributions
    -- Configuring done (1.4s)
    -- Generating done (0.0s)
    -- Build files have been written to: /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64
    *** Building project with Ninja...
    [1/26] Creating directories for 'CMakeProject-src-download'
    [1/26] Performing download step (download, verify and extract) for 'CMakeProject-src-download'
    -- Downloading...
       dst='/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/cmake-3.30.4.tar.gz'
       timeout='none'
       inactivity timeout='none'
    -- Using src='https://github.com/Kitware/CMake/releases/download/v3.30.4/cmake-3.30.4.tar.gz'
    -- [download 0% complete]
    -- [download 1% complete]
    -- [download 2% complete]
    -- [download 3% complete]
    -- [download 4% complete]
    -- [download 5% complete]
    -- [download 6% complete]
    -- [download 7% complete]
    -- [download 8% complete]
    -- [download 9% complete]
    -- [download 10% complete]
    -- [download 11% complete]
    -- [download 12% complete]
    -- [download 13% complete]
    -- [download 14% complete]
    ........ # truncated
    -- [download 96% complete]
    -- [download 97% complete]
    -- [download 98% complete]
    -- [download 99% complete]
    -- [download 100% complete]
    -- verifying file...
           file='/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/cmake-3.30.4.tar.gz'
    -- Downloading... done
    -- extracting...
         src='/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/cmake-3.30.4.tar.gz'
         dst='/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/CMake-src'
    -- extracting... [tar xfz]
    -- extracting... [analysis]
    -- extracting... [rename]
    -- extracting... [clean up]
    -- extracting... done
    [3/26] No update step for 'CMakeProject-src-download'
    [4/26] No patch step for 'CMakeProject-src-download'
    [5/26] No configure step for 'CMakeProject-src-download'
    [6/26] No build step for 'CMakeProject-src-download'
    [7/26] No install step for 'CMakeProject-src-download'
    [8/26] Completed 'CMakeProject-src-download'
    [9/26] Creating directories for 'CMakeProject-build'
    [10/26] No download step for 'CMakeProject-build'
    [11/26] No update step for 'CMakeProject-build'
    [12/26] No patch step for 'CMakeProject-build'
    [12/26] Performing configure step for 'CMakeProject-build'
    loading initial cache file /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/initial-cache.txt
    loading initial cache file /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build-prefix/tmp/CMakeProject-build-cache-Release.cmake
    -- The C compiler identification is Clang 19.1.2
    -- The CXX compiler identification is Clang 19.1.2
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Check for working C compiler: /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang
    -- Check for working C compiler: /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang - broken
    CMake Error at /data/data/com.termux/files/usr/share/cmake-3.30/Modules/CMakeTestCCompiler.cmake:67 (message):
      The C compiler

        "/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang"

      is not able to compile a simple test program.

      It fails with the following output:

        Change Dir: '/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build/CMakeFiles/CMakeScratch/TryCompile-bZ1CnQ'

        Run Build Command(s): /data/data/com.termux/files/usr/bin/ninja -v cmTC_2313a
        [1/2] /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang   -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1  -O2 -g -DNDEBUG -MD -MT CMakeFiles/cmTC_2313a.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_2313a.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_2313a.dir/testCCompiler.c.o -c /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build/CMakeFiles/CMakeScratch/TryCompile-bZ1CnQ/testCCompiler.c
        [2/2] : && /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1  -O2 -g -DNDEBUG -lstdc++ -lgcc -lrt CMakeFiles/cmTC_2313a.dir/testCCompiler.c.o -o cmTC_2313a   && :
        FAILED: cmTC_2313a
        : && /data/data/com.termux/files/usr/bin/aarch64-linux-android-clang -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1  -O2 -g -DNDEBUG -lstdc++ -lgcc -lrt CMakeFiles/cmTC_2313a.dir/testCCompiler.c.o -o cmTC_2313a   && :
        ld.lld: error: unable to find library -lgcc # gcc isn't available on termux
        aarch64-linux-android-clang: error: linker command failed with exit code 1 (use -v to see invocation)
        ninja: build stopped: subcommand failed.





      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:8 (project)


    -- Configuring incomplete, errors occurred!
    FAILED: CMakeProject-build-prefix/src/CMakeProject-build-stamp/CMakeProject-build-configure /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build-prefix/src/CMakeProject-build-stamp/CMakeProject-build-configure
    cd /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build && /data/data/com.termux/files/usr/bin/cmake -C /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/initial-cache.txt -GNinja -C/data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build-prefix/tmp/CMakeProject-build-cache-Release.cmake -S /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/CMake-src -B /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build && /data/data/com.termux/files/usr/bin/cmake -E touch /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33/build/py3-none-linux_aarch64/CMakeProject-build-prefix/src/CMakeProject-build-stamp/CMakeProject-build-configure
    ninja: build stopped: subcommand failed.

    *** CMake build failed
    error: subprocess-exited-with-error

    × Building wheel for cmake (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /data/data/com.termux/files/usr/bin/python3.12 /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /data/data/com.termux/files/usr/tmp/tmp26kwjtnv
    cwd: /data/data/com.termux/files/usr/tmp/pip-install-x3u9wrnm/cmake_9df87da17b1d40df9db3ff3d227a9e33
    Building wheel for cmake (pyproject.toml): finished with status 'error'
    ERROR: Failed building wheel for cmake
  Failed to build cmake
  ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cmake)
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /data/data/com.termux/files/usr/bin/python3.12 /data/data/com.termux/files/usr/lib/python3.12/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-i072ghtl/overlay --no-warn-script-location --disable-pip-version-check -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=70' cmake
  cwd: [inherit]
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

While installing from source resolves one issue and allows for a successful installation, another problem emerges because the source installation doesn't creates the dist-info directory within site-packages. Consequently, other PyPI packages (e.g., angr) attempt to locate the z3-solver installation during pip installation and, not finding it, default to attempting reinstallation via pip. To address this, I had to manually create the dist-info directory.

Also there's another solution i've found is using tur-repo, they provide gcc un-officially for termux.

Or there's this issue on their gh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions