'Error installing Matplotlib in termux: subprocess.CalledProcessError: Command '[...]' returned non-zero exit status 2

I am trying to install matplolib on android device using termux, but have been failing

checking for fgrep... /data/data/com.termux/files/usr/bin/grep -F

      checking for ld used by aarch64-linux-android-clang... no
      configure: error: no acceptable ld found in $PATH
      make: *** [builds/unix/detect.mk:85: setup] Error 1
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>

.......


File "/data/data/com.termux/files/usr/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['./configure', '--with-zlib=no', '--with-bzip2=no', '--with-png=no', '--with-harfbuzz=no', '--enable-static', '--disable-shared', '--host=x86_64-pc-linux-gnu']' returned non-zero exit status 2.

I tried to add LDFLAGS="-L/system/lib64/" to install Matplotlib, but it still failed



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source