Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
zlib requirement on Alpine Linux #1763
hey, I was trying to install Pillow on Alpine Linux 3.3 official docker container by "pip install pillow", but I get this error:
ValueError: --enable-zlib requested but zlib not found, aborting.
I have installed all the zlib library as I know, zlib-dev, libzip-dev by "apk add", and I checked /usr/include/libzip.h, which is 1.2.8, I'm not sure if there's something wrong with the library file or filename.
UPDATE: After I copied /lib/libz.so and /lib/libz.a to /usr/lib/ (which is installed by default), the installation has finished successfully. Guess /lib/ should be in the library check list?
The library it's looking for is zlib and zlib.h. libzip is something else (zip archives).
It looks like we're not actually looking in /lib on linux machines since most of the distros have shifted to multiarch library paths. It's certainly possible to add it by setting the environment variables C_INCLUDE_PATH/CPATH/INCLUDE and LD_RUN_PATH/LIBRARY_PATH/LIB.
(It's also possible that one of those paths has been added from the python config, which may be why /usr/lib works on Alpine)
And as an aside, that error should have been `'%s is required unless explicitly disabled using --disable-%s, aborting', but the feature name is spelled incorrectly.
referenced this issue
Mar 8, 2016
The official zlib-dev package in Alpine has the headers stored in /lib/. See the package contents here:
Note: you need to call pip via a new shell to have the variable take effect.