The package zlib is required in order to install Pillow which is an image manipulation application used by pythonists. zlib is available within the desktop version of busybox. It would be wonderful to have it in termux.
The zlib library is installed by the Android system so is not needed to add to Termux. If you install a compiler (gcc/clang) you will get the include/zlib.h header files, and should be able to link against the system zlib with
gcc -lz test.c
I'm closing this issue, re-open it if there are any problems with the system zlib!
I see it's at /data/data/com.termux/files/usr/include/zlib.h.
However pip install nikola fails while pulling in Pillow as dependency:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/data/data/com.termux/files/usr/tmp/pip-build-ja6h_mrl/Pillow/setup.py", line 788, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
So there there is some path configuration issue.
@jean does running it under termux-chroot succeeds?
This works :-)
LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install Pillow from
https://github.com/python-pillow/Pillow/issues/1957#issuecomment-301188386
Now it's failing on jpeg :-p
This worked all the way:
$ pkg install libjpeg-turbo-dev
$ LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install Pillow
In January 2018 on Android 7.0 I had to do
pkg install libllvm
pkg install libjpeg-turbo-dev
pkg install clang
pkg install python-dev
LDFLAGS="-L/system/lib/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install img2pdf
when I wanted to install img2pdf虁
It's not ideal to override CFLAGS - some packages treat it as additional flags, but others use it directly.
Something like this should work:
LIBRARY_PATH="/system/lib" CPATH="$PREFIX/include" pip install pillow
Most helpful comment
In January 2018 on Android 7.0 I had to do
when I wanted to install img2pdf虁