Zlib For Mac

Posted on
Hi All,
Okay, so I'm having this strange problem. I downloaded the source for Celestia at celestia.sourceforge.net and I'm attempting to compile it. I followed the instructions, and typed './configure --with-kde' at the prompt, and it was going through the configure when it abruptly ended ends. Here's a paste of the latest few lines, ending in the error 'zlib not found':
-----------------------
checking whether to be pedantic... no
checking whether to do profiling... no
checking whether to enable GLUT... no
checking whether to enable GTK... no
checking whether to enable Gnome... no
checking whether to enable KDE... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking whether we are using the GNU C++ compiler... (cached) no
checking whether g++ accepts -g... (cached) no
checking dependency style of g++... (cached) none
checking whether g++ supports -Wundef... no
checking whether g++ supports -Wno-long-long... no
checking whether g++ supports -Wnon-virtual-dtor... no
checking how to run the C++ preprocessor... /lib/cpp
checking whether g++ supports -frepo... no
checking whether g++ supports -instances=explicit... no
checking for X... no
checking for deflate in -lz... no
configure: error: zlib not found.
----------------------
At first I thought that zlib wasn't installed, so I downloaded it from www.zlib.org and compiled it and even ran the test program that came included with it and everything seems to be running properly on the zlib end. So, my question is, what is going wrong? How can I get this program to compile properly? I'm still relatively new at Linux so please understand if I'm missing something crucial here. If it's relevant, i'm running on the StartCom Multimedia distribution (based on RH9).
ALSO: Please note the following thread for the latest info regarding this issue: http://www.linuxquestions.org/questi...43#post1269243
Thank you,
Quordandis

Warnings¶

Warning

Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL.

Warning

ZLib.Ada provide Ada style access to the ZLib C. Express Zip Free Mac Compression Software v.2.14 Express Zip Free Mac File Compression Software. Easily create, edit, manage and extract zipped files and folders on OS X. Zip/compress to reduce file size for email transmission or save hard drive disc space when archiving. Libpng is the official PNG reference library. It supports almost all PNG features, is extensible, and has been extensively tested for over 23 years. The home site for development versions (i.e., may be buggy or subject to change or include experimental features) is and the place to go for questions about the library is the png-mng-implement mailing list.

  1. The Missing Package Manager for macOS (or Linux). It's all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.
  2. Zlib.decompressobj (wbits=MAXWBITS , zdict) ¶ Returns a decompression object, to be used for decompressing data streams that won’t fit into memory at once. The wbits parameter controls the size of the history buffer (or the “window size”), and what header and trailer format is expected.

Pillow >= 1.0 no longer supports “import Image”. Please use “from PIL import Image” instead.

Warning

Pillow >= 2.1.0 no longer supports “import _imaging”. Please use “from PIL.Image import core as _imaging” instead.

Python Support¶

Pillow supports these Python versions.

Python

3.9

3.8

3.7

3.6

3.5

3.4

3.3

3.2

2.7

2.6

2.5

2.4

Pillow >= 8.0

Yes

Yes

Yes

Yes

Pillow 7.0 - 7.2

Yes

Yes

Yes

Yes

Pillow 6.2.1 - 6.2.2

Yes

Yes

Yes

Yes

Yes

Pillow 6.0 - 6.2.0

Yes

Yes

Yes

Yes

Pillow 5.2 - 5.4

Yes

Yes

Yes

Yes

Yes

Pillow 5.0 - 5.1

Yes

Yes

Yes

Yes

Pillow 4

Yes

Yes

Yes

Yes

Yes

Pillow 2 - 3

Yes

Yes

Yes

Yes

Yes

Yes

Pillow < 2

Yes

Yes

Yes

Yes

Zlib For Macos

Basic Installation¶

Note

The following instructions will install Pillow with support formost common image formats. See External Libraries for afull list of external libraries supported.

Install Pillow with pip:

Windows Installation¶

We provide Pillow binaries for Windows compiled for the matrix ofsupported Pythons in both 32 and 64-bit versions in the wheel format.These binaries have all of the optional libraries included exceptfor raqm, libimagequant, and libxcb:

To install Pillow in MSYS2, see Building on Windows using MSYS2/MinGW.

macOS Installation¶

We provide binaries for macOS for each of the supported Pythonversions in the wheel format. These include support for all optionallibraries except libimagequant and libxcb. Raqm support requireslibraqm, fribidi, and harfbuzz to be installed separately:

Linux Installation¶

We provide binaries for Linux for each of the supported Pythonversions in the manylinux wheel format. These include support for alloptional libraries except libimagequant. Raqm support requireslibraqm, fribidi, and harfbuzz to be installed separately:

Most major Linux distributions, including Fedora, Debian/Ubuntu andArchLinux also include Pillow in packages that previously containedPIL e.g. python-imaging.

FreeBSD Installation¶

Pillow can be installed on FreeBSD via the official Ports or Packages systems:

Ports:

Packages:

Note

The Pillow FreeBSD port and packagesare tested by the ports team with all supported FreeBSD versions.

Building From Source¶

Download and extract the compressed archive from PyPI.

External Libraries¶

Note

You do not need to install all supported external libraries touse Pillow’s basic features. Zlib and libjpeg are requiredby default.

Note

There are Dockerfiles in our Docker images repo to install thedependencies for some operating systems.

Many of Pillow’s features require external libraries:

  • libjpeg provides JPEG functionality.

    • Pillow has been tested with libjpeg versions 6b, 8, 9-9d andlibjpeg-turbo version 8.

    • Starting with Pillow 3.0.0, libjpeg is required by default, butmay be disabled with the --disable-jpeg flag.

  • zlib provides access to compressed PNGs

    • Starting with Pillow 3.0.0, zlib is required by default, but maybe disabled with the --disable-zlib flag.

  • libtiff provides compressed TIFF functionality

    • Pillow has been tested with libtiff versions 3.x and 4.0-4.1

  • libfreetype provides type related services

  • littlecms provides color management

    • Pillow version 2.2.1 and below uses liblcms1, Pillow 2.3.0 andabove uses liblcms2. Tested with 1.19 and 2.7-2.11.

  • libwebp provides the WebP format.

    • Pillow has been tested with version 0.1.3, which does not readtransparent WebP files. Versions 0.3.0 and above supporttransparency.

  • tcl/tk provides support for tkinter bitmap and photo images.

  • openjpeg provides JPEG 2000 functionality.

    • Pillow has been tested with openjpeg 2.0.0, 2.1.0 and 2.3.1.

    • Pillow does not support the earlier 1.5 series which shipswith Debian Jessie.

  • libimagequant provides improved color quantization

    • Pillow has been tested with libimagequant 2.6-2.12.6

    • Libimagequant is licensed GPLv3, which is more restrictive thanthe Pillow license, therefore we will not be distributing binarieswith libimagequant support enabled.

  • libraqm provides complex text layout support.

    • libraqm provides bidirectional text support (using FriBiDi),shaping (using HarfBuzz), and proper script itemization. As aresult, Raqm can support most writing systems covered by Unicode.

    • libraqm depends on the following libraries: FreeType, HarfBuzz,FriBiDi, make sure that you install them before installing libraqmif not available as package in your system.

    • setting text direction or font features is not supported withoutlibraqm.

    • libraqm is dynamically loaded in Pillow 5.0.0 and above, so supportis available if all the libraries are installed.

    • Windows support: Raqm is not included in prebuilt wheels

  • libxcb provides X11 screengrab support.

Once you have installed the prerequisites, run:

If the prerequisites are installed in the standard library locationsfor your machine (e.g. /usr or /usr/local), noadditional configuration should be required. If they are installed ina non-standard location, you may need to configure setuptools to usethose locations by editing setup.py orsetup.cfg, or by adding environment variables on the commandline:

If Pillow has been previously built without the requiredprerequisites, it may be necessary to manually clear the pip cache orbuild without cache using the --no-cache-dir option to force abuild with newly installed external libraries.

Build Options¶

  • Environment variable: MAX_CONCURRENCY=n. Pillow can usemultiprocessing to build the extension. Setting MAX_CONCURRENCYsets the number of CPUs to use, or can disable parallel building byusing a setting of 1. By default, it uses 4 CPUs, or if 4 are notavailable, as many as are present.

  • Build flags: --disable-zlib, --disable-jpeg,--disable-tiff, --disable-freetype, --disable-lcms,--disable-webp, --disable-webpmux, --disable-jpeg2000,--disable-imagequant, --disable-xcb.Disable building the corresponding feature even if the developmentlibraries are present on the building machine.

  • Build flags: --enable-zlib, --enable-jpeg,--enable-tiff, --enable-freetype, --enable-lcms,--enable-webp, --enable-webpmux, --enable-jpeg2000,--enable-imagequant, --enable-xcb.Require that the corresponding feature is built. The build will raisean exception if the libraries are not found. Webpmux (WebP metadata)relies on WebP support. Tcl and Tk also must be used together.

  • Build flag: --disable-platform-guessing. Skips all of theplatform dependent guessing of include and library directories forautomated build systems that configure the proper paths in theenvironment variables (e.g. Buildroot).

  • Build flag: --debug. Adds a debugging flag to the include andlibrary search process to dump all paths searched for and found tostdout.

Sample usage:

or using pip:

Building on macOS¶

The Xcode command line tools are required to compile portions ofPillow. The tools are installed by running xcode-select--installfrom the command line. The command line tools are required even if youhave the full Xcode package installed. It may be necessary to runsudoxcodebuild-license to accept the license prior to using thetools.

The easiest way to install external libraries is via Homebrew. After you install Homebrew, run:

To install libraqm on macOS use Homebrew to install its dependencies:

Then see depends/install_raqm_cmake.sh to install libraqm.

Zlib For Mac

Now install Pillow with:

Zlib macros

or from within the uncompressed source directory:

Building on Windows¶

We recommend you use prebuilt wheels from PyPI.If you wish to compile Pillow manually, you can use the build scriptsin the winbuild directory used for CI testing and development.These scripts require Visual Studio 2017 or newer and NASM.

Building on Windows using MSYS2/MinGW¶

To build Pillow using MSYS2, make sure you run the MSYS2 MinGW 32-bit orMSYS2 MinGW 64-bit console, notMSYS2 directly.

The following instructions target the 64-bit build, for 32-bitreplace all occurrences of mingw-w64-x86_64- with mingw-w64-i686-.

Make sure you have Python and GCC installed:

Prerequisites are installed on MSYS2 MinGW 64-bit with:

Now install Pillow with:

Building on FreeBSD¶

Make sure you have Python’s development libraries installed:

Prerequisites are installed on FreeBSD 10 or 11 with:

Then see depends/install_raqm_cmake.sh to install libraqm.

Building on Linux¶

If you didn’t build Python from source, make sure you have Python’sdevelopment libraries installed.

In Debian or Ubuntu:

In Fedora, the command is:

Note

redhat-rpm-config is required on Fedora 23, but not earlier versions.

Prerequisites for Ubuntu 16.04 LTS - 20.04 LTS are installed with:

Then see depends/install_raqm.sh to install libraqm.

Prerequisites are installed on recent Red Hat, CentOS or Fedora with:

Note that the package manager may be yum or DNF, depending on theexact distribution.

See also the Dockerfiles in the Test Infrastructure repo(https://github.com/python-pillow/docker-images) for a known workinginstall process for other tested distros.

Building on Android¶

Basic Android support has been added for compilation within the Termuxenvironment. The dependencies can be installed by:

This has been tested within the Termux app on ChromeOS, on x86.

Platform Support¶

Current platform support for Pillow. Binary distributions arecontributed for each release on a volunteer basis, but the sourceshould compile and run everywhere platform support is listed. Ingeneral, we aim to support all current versions of Linux, macOS, andWindows.

Continuous Integration Targets¶

These platforms are built and tested for every change.

C++ Zlib Uncompress

Operating system

Tested Python versions

Tested architecture

Alpine

3.8

x86-64

Arch

3.8

x86-64

Amazon Linux 1

3.6

x86-64

Amazon Linux 2

3.7

x86-64

CentOS 6

3.6

x86-64

CentOS 7

3.6

x86-64

CentOS 8

3.6

x86-64

Debian 10 Buster

3.7

x86

Fedora 31

3.7

x86-64

Fedora 32

3.8

x86-64

macOS 10.15 Catalina

3.6, 3.7, 3.8, 3.9, PyPy3

x86-64

Ubuntu Linux 16.04 LTS (Xenial)

3.6, 3.7, 3.8, PyPy3

x86-64

Ubuntu Linux 18.04 LTS (Bionic)

3.6, 3.7, 3.8, 3.9, PyPy3

x86-64

Ubuntu Linux 20.04 LTS (Focal)

3.8

x86-64

Windows Server 2016

3.8

x86

3.6

x86-64

Windows Server 2019

3.6, 3.7, 3.8, 3.9

x86, x86-64

PyPy3

x86

3.8/MinGW

x86, x86-64

Other Platforms¶

These platforms have been reported to work at the versions mentioned.

Note

Contributors please test Pillow on your platform then update thisdocument and send a pull request.

Pyenv Zlib

Operating system

Tested Python versions

Latest tested Pillow version

Tested processors

macOS 10.15 Catalina

3.5, 3.6, 3.7, 3.8

7.2.0

x86-64

macOS 10.14 Mojave

3.5, 3.6, 3.7, 3.8

7.2.0

x86-64

2.7

6.0.0

3.4

5.4.1

macOS 10.13 High Sierra

2.7, 3.4, 3.5, 3.6

4.2.1

x86-64

macOS 10.12 Sierra

2.7, 3.4, 3.5, 3.6

4.1.1

x86-64

Mac OS X 10.11 El Capitan

2.7, 3.4, 3.5, 3.6, 3.7

5.4.1

x86-64

3.3

4.1.0

Mac OS X 10.9 Mavericks

2.7, 3.2, 3.3, 3.4

3.0.0

x86-64

Mac OS X 10.8 Mountain Lion

2.6, 2.7, 3.2, 3.3

x86-64

Redhat Linux 6

2.6

x86

CentOS 6.3

2.7, 3.3

x86

Fedora 23

2.7, 3.4

3.1.0

x86-64

Ubuntu Linux 12.04 LTS (Precise)

2.6, 3.2, 3.3, 3.4, 3.5PyPy5.3.1, PyPy3 v2.4.0

3.4.1

x86,x86-64

2.7

4.3.0

x86-64

2.7, 3.2

3.4.1

ppc

Ubuntu Linux 10.04 LTS (Lucid)

2.6

2.3.0

x86,x86-64

Debian 8.2 Jessie

2.7, 3.4

3.1.0

x86-64

Raspbian Jessie

2.7, 3.4

3.1.0

arm

Raspbian Stretch

2.7, 3.5

4.0.0

arm

Gentoo Linux

2.7, 3.2

2.1.0

x86-64

FreeBSD 11.1

2.7, 3.4, 3.5, 3.6

4.3.0

x86-64

FreeBSD 10.3

2.7, 3.4, 3.5

4.2.0

x86-64

FreeBSD 10.2

2.7, 3.4

3.1.0

x86-64

Windows 10

3.7

7.1.0

x86-64

Windows 8.1 Pro

2.6, 2.7, 3.2, 3.3, 3.4

2.4.0

x86,x86-64

Windows 8 Pro

2.6, 2.7, 3.2, 3.3, 3.4a3

2.2.0

x86,x86-64

Windows 7 Professional

3.7

7.0.0

x86,x86-64

Windows Server 2008 R2 Enterprise

3.3

x86-64

Old Versions¶

Brew Zlib

You can download old distributions from the release history at PyPI and by direct URL accesseg. https://pypi.org/project/Pillow/1.0/.