Running Plone 5.2.5 installer on macOS 11.6 – error building Pillow / missing zlib files

Continuing the discussion from Running Plone 5.2.5 unified installer on macOS 12:

OK this time (different machine), the installer failed trying to install Pillow. Going to the ~/Plone/zinstance folder and bin/pip install Pillow==6.2.2 failed with the same error, that the needed zlib include files could not be found.

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

This was what worked: homebrew - brew install zlib-devel on Mac OS X Mavericks - Stack Overflow

For compilers to find zlib you may need to set:

export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"

then bin/pip install Pillow==6.2.2 succeeded.

I reran the ./ standalone command and it succeeded (after I commented out line 812 that exits if the RINSTANCE_HOME directory already exists...we should make that an option)

# Determine and check instance home
if [ $INSTALL_ZEO -eq 1 ]; then
elif [ $INSTALL_STANDALONE -eq 1 ]; then
if [ -x "$INSTANCE_HOME" ]; then
    eval "echo \"$INSTANCE_HOME_EXISTS\""
#    exit 1
1 Like

I had similar problems trying to install 5.2.10 standalone. I always use brew to install zlib and libjpeg on my system. After tinkering with things for a few hours, I think the issue though may be that older home-brew installed libraries in /usr/local/opt and today (2022) home-brew places libraries and headers in /opt/homebrew/lib

For compilers to find zlib you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"

For pkg-config to find zlib you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"

For compilers to find jpeg you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/jpeg/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/jpeg/include"

For pkg-config to find jpeg you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig"

I too commented out lines 810-813 in so I could just rerun my target.