Repository: python-pillow/Pillow

Issue:
Unable to install on macOS Big Sur (zlib missing)

### What did you do?

I am trying to install Pillow (since it's required for `matplotlib`). I am running macOS Big Sur beta 3 (20A5323l), with Python 3.8.5 installed with homebrew. I also have numpy and zlib installed through homebrew.

When I try to install Pillow with pip, I get the following error:
```
➜ sudo -H python3 -m pip install --upgrade Pillow
Collecting Pillow
  Using cached Pillow-7.2.0.tar.gz (39.1 MB)
Building wheels for collected packages: Pillow
  Building wheel for Pillow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-3hwcm3o0
       cwd: /private/tmp/pip-install-5mo6rr9f/Pillow/
  Complete output (170 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11.0-x86_64-3.8
  creating build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageMode.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/TarIO.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageStat.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageColor.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ContainerIO.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/_version.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageQt.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageMath.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PaletteFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/FontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PdfParser.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ExifTags.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageCms.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageChops.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PSDraw.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageFilter.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImagePath.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/__init__.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/JpegPresets.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/features.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageDraw.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageWin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageMorph.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/WalImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageTk.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageOps.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageShow.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageGrab.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/TiffTags.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/_util.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/GdImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImagePalette.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageTransform.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageSequence.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PyAccess.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/_binary.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/Image.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/__main__.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/ImageFont.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.ci'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext


  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 864, in <module>
      setup(
    File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 694, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: zlib

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 918, 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.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html


  ----------------------------------------
  ERROR: Failed building wheel for Pillow
  Running setup.py clean for Pillow
Failed to build Pillow
Installing collected packages: Pillow
    Running setup.py install for Pillow ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-i9qpkwl7/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/Pillow
         cwd: /private/tmp/pip-install-5mo6rr9f/Pillow/
    Complete output (172 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-11.0-x86_64-3.8
    creating build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageMode.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/TarIO.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageStat.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageColor.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ContainerIO.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/_version.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageQt.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageMath.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PaletteFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/FontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PdfParser.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ExifTags.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageCms.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageChops.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PSDraw.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageFilter.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImagePath.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/__init__.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/JpegPresets.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/features.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageDraw.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageWin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageMorph.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/WalImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageTk.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageOps.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageShow.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageGrab.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/TiffTags.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/_util.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/GdImageFile.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImagePalette.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageTransform.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageSequence.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PyAccess.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/_binary.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/Image.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/__main__.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/ImageFont.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.macosx-11.0-x86_64-3.8/PIL
    running egg_info
    writing src/Pillow.egg-info/PKG-INFO
    writing dependency_links to src/Pillow.egg-info/dependency_links.txt
    writing top-level names to src/Pillow.egg-info/top_level.txt
    reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'codecov.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.ci'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext


    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 864, in <module>
        setup(
      File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 694, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py", line 918, 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.

    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html


    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5mo6rr9f/Pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-i9qpkwl7/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/Pillow Check the logs for full command output.
```

When I try to install with easy_install, I get similar errors:
```➜ sudo -H python3 -m easy_install Pillow
WARNING: The easy_install command is deprecated and will be removed in a future version.
Searching for Pillow
Reading https://pypi.org/simple/Pillow/
Downloading https://files.pythonhosted.org/packages/3e/02/b09732ca4b14405ff159c470a612979acfc6e8645dc32f83ea0129709f7a/Pillow-7.2.0.tar.gz#sha256=97f9e7953a77d5a70f49b9a48da7776dc51e9b738151b22dacf101641594a626
Best match: Pillow 7.2.0
Processing Pillow-7.2.0.tar.gz
Writing /tmp/easy_install-u80im5vs/Pillow-7.2.0/setup.cfg
Running Pillow-7.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-u80im5vs/Pillow-7.2.0/egg-dist-tmp-dpy_ylgh
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.ci'


The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
  File "/tmp/easy_install-u80im5vs/Pillow-7.2.0/setup.py", line 864, in <module>
  File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 174, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 160, in call_command
    self.run_command(cmdname)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/tmp/easy_install-u80im5vs/Pillow-7.2.0/setup.py", line 694, in build_extensions
__main__.RequiredDependencyException: zlib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-u80im5vs/Pillow-7.2.0/setup.py", line 918, in <module>
__main__.RequiredDependencyException:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/easy_install.py", line 5, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 2307, in main
    setup(
  File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 425, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 686, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 712, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 897, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1167, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1151, in run_setup
    run_setup(setup_script, args)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/usr/local/lib/python3.8/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/usr/local/lib/python3.8/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-u80im5vs/Pillow-7.2.0/setup.py", line 918, in <module>
setuptools.sandbox.UnpickleableException: RequiredDependencyException('\n\nThe headers or library files could not be found for zlib,\na required dependency when compiling Pillow from source.\n\nPlease see the install instructions at:\n   https://pillow.readthedocs.io/en/latest/installation.html\n\n')
```


### What did you expect to happen?
Pillow will properly install.


### What actually happened?
Error message shown above

### What are your OS, Python and Pillow versions?

* OS: macOS Big Sur (11.0/10.16) Beta 3
* Python: 3.8.5 from homebrew
* Pillow: attempting to install 7.2.0 (or any version)

### What else have you tried?

I followed every solution given in #4242 including downgrading pip, upgrading pip, specifying different Pillow versions, and using easy_install. I have installed, uninstalled, and reinstalled zlib from homebrew.


Discussion:
Please could you try some suggestions from https://github.com/python-pillow/Pillow/issues/3438? 
> Please could you try some suggestions from #3438?

Hmm, none of those solutions seem to apply/do anything. I have CommandLine Tools installed, but I don't have the Packages directory so I can't run `sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers...`. I already have openssl and openssl@1.1 installed through homebrew, and adding stuff to my LDFLAGS, CPATH, CPPFLAGS, and PKG_CONFIG_PATH doesn't change anything.
I´m also having the same problem
I'm having the same problem today
First, It's a unreleased OS, not publicly available, so the support level is "It might work" until it's out. At that point I expect that we'll have a developer on Big Sur to debug it.

Second, I suspect that the problem is that it's looking for wheels for macosx_11.0, not macos_10.whatevers, so none of the binaries are matching, even though it's likely binary compatible with the catalina compatible wheels. This is probably a pip/packaging issue. 

Third, macos has switched library locations and build incantations quite a few times. It's going to take a while for the packaging community to work out what's actually changed here. 
The issue here is `compiler.include_dirs` doesn't have the correct set of paths in it, and thus we aren't finding it.

clang by default is using:

```
clang -cc1 version 12.0.0 (clang-1200.0.22.21) default target x86_64-apple-darwin20.0.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks (framework directory)
```

And indeed, `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/zlib.h` exists.

I believe Catalina had already got rid of `/usr/include`, so I don't know how/if this worked there?
I've created PR #4842 to try and address this.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -479,6 +479,9 @@ def build_extensions(self):
                 # add Homebrew's include and lib directories
                 _add_directory(library_dirs, os.path.join(prefix, "lib"))
                 _add_directory(include_dirs, os.path.join(prefix, "include"))
+                _add_directory(
+                    include_dirs, os.path.join(prefix, "opt", "zlib", "include")
+                )
                 ft_prefix = os.path.join(prefix, "opt", "freetype")
 
             if ft_prefix and os.path.isdir(ft_prefix):


Test patch: