- How to install Pillow on Windows using pip?
- 3 Answers 3
- Not the answer you’re looking for? Browse other questions tagged python pillow or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- Installation¶
- Warnings¶
- Python Support¶
- Windows Installation¶
- macOS Installation¶
- Linux Installation¶
- FreeBSD Installation¶
- Building From Source¶
- External Libraries¶
- Build Options¶
- Installation¶
- Warnings¶
- Python Support¶
- Windows Installation¶
- macOS Installation¶
- Linux Installation¶
- FreeBSD Installation¶
- Building From Source¶
- External Libraries¶
- Build Options¶
How to install Pillow on Windows using pip?
I’m trying to install Pillow 3.1 on Windows. Per the instructions, I should be able to just type in:
pip install Pillow
Because now (starting with versions after 3.0 I think?) libjpeg is required for pillow to be installed. I don’t know how to do that magic on Windows. Maybe install Ming or something. But I was really hoping for a simple pip install.
I can disable these options through the intuitive command:
But then the build fails because I don’t have Visual C++ installed.
Yes, I can install Pillow by downloading it from the unofficial repository list. But is there a way to do it with pip on Windows without a lot of extra installs?
3 Answers 3
By far the easiest thing to do on Windows is install Pillow using pre-built binaries rather than trying to build it yourself.
When there’s a new Pillow release, it usually takes a day or so for the Windows binaries to be built and uploaded.
You ran into this problem during this window. The Windows binaries are now up so you can install with pip install pillow (or pip install -U pillow ).
If you need Pillow during this window, you can install a given previous version with binaries like pip install pillow==3.0.0 .
I install it By running command prompt as administrator pip install Pillow also we can mention specific version like pip install Pillow==2.6.1
I spent almost a day figuring out what is wrong with pillow installation. It was working fine till yesterday and suddenly stopped working from today. Finally got it figured out, Few of my team mates upgraded python to 3.6 version which is now available for download. Since Pillow is not yet made compatible with 3.6 and is supporting only till 3.5.2 this error popped up.
Resolution is to check if Pillow supports your version of python. Once I reverted python back to 3.5.2 the installation worked like a charm and no errors encountered.
Hope this help resolve your issue.
Not the answer you’re looking for? Browse other questions tagged python pillow or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Installation¶
Warnings¶
Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL.
Pillow >= 1.0 no longer supports “import Image”. Please use “from PIL import Image” instead.
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 6.2.1 — 6.2.2
Pillow External Libraries for a full list of external libraries supported.
Install Pillow with pip:
Windows Installation¶
We provide Pillow binaries for Windows compiled for the matrix of supported Pythons in both 32 and 64-bit versions in the wheel format. These binaries include support for all optional libraries except libimagequant and libxcb. Raqm support requires FriBiDi to be installed separately:
macOS Installation¶
We provide binaries for macOS for each of the supported Python versions in the wheel format. These include support for all optional libraries except libimagequant. Raqm support requires FriBiDi to be installed separately:
Linux Installation¶
We provide binaries for Linux for each of the supported Python versions in the manylinux wheel format. These include support for all optional libraries except libimagequant. Raqm support requires FriBiDi to be installed separately:
Most major Linux distributions, including Fedora, Ubuntu and ArchLinux also include Pillow in packages that previously contained PIL e.g. python-imaging . Debian splits it into two packages, python3-pil and python3-pil.imagetk .
FreeBSD Installation¶
Pillow can be installed on FreeBSD via the official Ports or Packages systems:
Ports:
Packages:
The Pillow FreeBSD port and packages are tested by the ports team with all supported FreeBSD versions.
Building From Source¶
External Libraries¶
You do not need to install all supported external libraries to use Pillow’s basic features. Zlib and libjpeg are required by default.
There are Dockerfiles in our Docker images repo to install the dependencies 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 and libjpeg-turbo version 8.
Starting with Pillow 3.0.0, libjpeg is required by default, but may 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 may be 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 and above uses liblcms2. Tested with 1.19 and 2.7-2.12.
libwebp provides the WebP format.
Pillow has been tested with version 0.1.3, which does not read transparent WebP files. Versions 0.3.0 and above support transparency.
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, 2.3.1 and 2.4.0.
Pillow does not support the earlier 1.5 series which ships with Debian Jessie.
libimagequant provides improved color quantization
Pillow has been tested with libimagequant 2.6-2.14.1
Libimagequant is licensed GPLv3, which is more restrictive than the Pillow license, therefore we will not be distributing binaries with libimagequant support enabled.
libraqm provides complex text layout support.
libraqm provides bidirectional text support (using FriBiDi), shaping (using HarfBuzz), and proper script itemization. As a result, 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 libraqm if not available as package in your system.
Setting text direction or font features is not supported without libraqm.
Pillow wheels since version 8.2.0 include a modified version of libraqm that loads libfribidi at runtime if it is installed. On Windows this requires compiling FriBiDi and installing fribidi.dll into a directory listed in the Dynamic-Link Library Search Order (Microsoft Docs) ( fribidi-0.dll or libfribidi-0.dll are also detected). See Build Options to see how to build this version.
Previous versions of Pillow (5.0.0 to 8.1.2) linked libraqm dynamically at runtime.
libxcb provides X11 screengrab support.
Once you have installed the prerequisites, run:
If the prerequisites are installed in the standard library locations for your machine (e.g. /usr or /usr/local ), no additional configuration should be required. If they are installed in a non-standard location, you may need to configure setuptools to use those locations by editing setup.py or setup.cfg , or by adding environment variables on the command line:
If Pillow has been previously built without the required prerequisites, it may be necessary to manually clear the pip cache or build without cache using the —no-cache-dir option to force a build with newly installed external libraries.
Build Options¶
Environment variable: MAX_CONCURRENCY=n . Pillow can use multiprocessing to build the extension. Setting MAX_CONCURRENCY sets the number of CPUs to use, or can disable parallel building by using a setting of 1. By default, it uses 4 CPUs, or if 4 are not available, 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 development libraries 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 raise an exception if the libraries are not found. Webpmux (WebP metadata) relies on WebP support. Tcl and Tk also must be used together.
Build flags: —vendor-raqm —vendor-fribidi These flags are used to compile a modified version of libraqm and a shim that dynamically loads libfribidi at runtime. These are used to compile the standard Pillow wheels. Compiling libraqm requires a C99-compliant compiler.
Build flag: —disable-platform-guessing . Skips all of the platform dependent guessing of include and library directories for automated build systems that configure the proper paths in the environment variables (e.g. Buildroot).
Build flag: —debug . Adds a debugging flag to the include and library search process to dump all paths searched for and found to stdout.
Installation¶
Warnings¶
Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL.
Pillow >= 1.0 no longer supports “import Image”. Please use “from PIL import Image” instead.
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 6.2.1 — 6.2.2
Pillow External Libraries for a full list of external libraries supported.
Install Pillow with pip:
Windows Installation¶
We provide Pillow binaries for Windows compiled for the matrix of supported Pythons in both 32 and 64-bit versions in the wheel format. These binaries include support for all optional libraries except libimagequant and libxcb. Raqm support requires FriBiDi to be installed separately:
macOS Installation¶
We provide binaries for macOS for each of the supported Python versions in the wheel format. These include support for all optional libraries except libimagequant. Raqm support requires FriBiDi to be installed separately:
Linux Installation¶
We provide binaries for Linux for each of the supported Python versions in the manylinux wheel format. These include support for all optional libraries except libimagequant. Raqm support requires FriBiDi to be installed separately:
Most major Linux distributions, including Fedora, Ubuntu and ArchLinux also include Pillow in packages that previously contained PIL e.g. python-imaging . Debian splits it into two packages, python3-pil and python3-pil.imagetk .
FreeBSD Installation¶
Pillow can be installed on FreeBSD via the official Ports or Packages systems:
Ports:
Packages:
The Pillow FreeBSD port and packages are tested by the ports team with all supported FreeBSD versions.
Building From Source¶
External Libraries¶
You do not need to install all supported external libraries to use Pillow’s basic features. Zlib and libjpeg are required by default.
There are Dockerfiles in our Docker images repo to install the dependencies 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 and libjpeg-turbo version 8.
Starting with Pillow 3.0.0, libjpeg is required by default, but may 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 may be 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 and above uses liblcms2. Tested with 1.19 and 2.7-2.12.
libwebp provides the WebP format.
Pillow has been tested with version 0.1.3, which does not read transparent WebP files. Versions 0.3.0 and above support transparency.
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, 2.3.1 and 2.4.0.
Pillow does not support the earlier 1.5 series which ships with Debian Jessie.
libimagequant provides improved color quantization
Pillow has been tested with libimagequant 2.6-2.14.1
Libimagequant is licensed GPLv3, which is more restrictive than the Pillow license, therefore we will not be distributing binaries with libimagequant support enabled.
libraqm provides complex text layout support.
libraqm provides bidirectional text support (using FriBiDi), shaping (using HarfBuzz), and proper script itemization. As a result, 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 libraqm if not available as package in your system.
Setting text direction or font features is not supported without libraqm.
Pillow wheels since version 8.2.0 include a modified version of libraqm that loads libfribidi at runtime if it is installed. On Windows this requires compiling FriBiDi and installing fribidi.dll into a directory listed in the Dynamic-Link Library Search Order (Microsoft Docs) ( fribidi-0.dll or libfribidi-0.dll are also detected). See Build Options to see how to build this version.
Previous versions of Pillow (5.0.0 to 8.1.2) linked libraqm dynamically at runtime.
libxcb provides X11 screengrab support.
Once you have installed the prerequisites, run:
If the prerequisites are installed in the standard library locations for your machine (e.g. /usr or /usr/local ), no additional configuration should be required. If they are installed in a non-standard location, you may need to configure setuptools to use those locations by editing setup.py or setup.cfg , or by adding environment variables on the command line:
If Pillow has been previously built without the required prerequisites, it may be necessary to manually clear the pip cache or build without cache using the —no-cache-dir option to force a build with newly installed external libraries.
Build Options¶
Environment variable: MAX_CONCURRENCY=n . Pillow can use multiprocessing to build the extension. Setting MAX_CONCURRENCY sets the number of CPUs to use, or can disable parallel building by using a setting of 1. By default, it uses 4 CPUs, or if 4 are not available, 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 development libraries 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 raise an exception if the libraries are not found. Webpmux (WebP metadata) relies on WebP support. Tcl and Tk also must be used together.
Build flags: —vendor-raqm —vendor-fribidi These flags are used to compile a modified version of libraqm and a shim that dynamically loads libfribidi at runtime. These are used to compile the standard Pillow wheels. Compiling libraqm requires a C99-compliant compiler.
Build flag: —disable-platform-guessing . Skips all of the platform dependent guessing of include and library directories for automated build systems that configure the proper paths in the environment variables (e.g. Buildroot).
Build flag: —debug . Adds a debugging flag to the include and library search process to dump all paths searched for and found to stdout.