2013-10-09 04:13:06 +04:00
Installation
============
2015-05-08 14:28:50 +03:00
Warnings
--------
2015-04-04 15:11:18 +03:00
.. warning :: Pillow and PIL cannot co-exist in the same environment. Before installing Pillow, please uninstall PIL.
2013-10-15 16:47:10 +04:00
.. warning :: Pillow >= 1.0 no longer supports "import Image". Please use "from PIL import Image" instead.
2015-04-04 15:11:18 +03:00
.. warning :: Pillow >= 2.1.0 no longer supports "import _imaging". Please use "from PIL.Image import core as _imaging" instead.
2013-10-15 16:51:15 +04:00
2015-05-08 14:28:50 +03:00
Notes
-----
2013-10-15 16:51:15 +04:00
.. note :: Pillow < 2.0.0 supports Python versions 2.4, 2.5, 2.6, 2.7.
2013-10-15 16:48:52 +04:00
2015-04-04 15:11:18 +03:00
.. note :: Pillow >= 2.0.0 supports Python versions 2.6, 2.7, 3.2, 3.3, 3.4
2015-04-04 15:12:15 +03:00
Basic Installation
------------------
2013-10-09 04:13:06 +04:00
.. note ::
2015-04-04 15:17:29 +03:00
The following instructions will install Pillow with support for most common image formats. See :ref: `external-libraries` for a full list of external libraries supported.
2013-10-09 04:13:06 +04:00
2015-04-04 15:18:45 +03:00
Install Pillow with :command: `pip` ::
2013-10-09 04:13:06 +04:00
$ pip install Pillow
2015-04-04 15:24:41 +03:00
Or use :command: `easy_install` for installing `Python Eggs <http://peak.telecommunity.com/DevCenter/PythonEggs> `_ as :command: `pip` does not support them::
2013-10-09 04:13:06 +04:00
$ easy_install Pillow
2015-04-04 15:18:45 +03:00
Or download and extract the `compressed archive from PyPI`_ and inside it run::
2013-10-09 04:13:06 +04:00
$ python setup.py install
.. _compressed archive from PyPI: https://pypi.python.org/pypi/Pillow
.. _external-libraries:
2015-04-18 01:00:53 +03:00
External Libraries
2013-10-09 04:13:06 +04:00
------------------
2014-07-04 23:17:23 +04:00
.. note ::
2015-04-04 15:27:45 +03:00
You **do not need to install all external libraries supported** to use Pillow's basic features.
2014-07-04 23:17:23 +04:00
2013-10-09 04:13:06 +04:00
Many of Pillow's features require external libraries:
* **libjpeg** provides JPEG functionality.
2014-11-19 23:14:57 +03:00
* Pillow has been tested with libjpeg versions **6b** , **8** , and **9** and libjpeg-turbo version **8** .
2013-10-09 04:13:06 +04:00
* **zlib** provides access to compressed PNGs
2014-11-19 23:14:57 +03:00
* **libtiff** provides compressed TIFF functionality
2013-10-09 04:13:06 +04:00
* Pillow has been tested with libtiff versions **3.x** and **4.0**
* **libfreetype** provides type related services
* **littlecms** provides color management
2013-11-30 22:06:21 +04:00
* Pillow version 2.2.1 and below uses liblcms1, Pillow 2.3.0 and
above uses liblcms2. Tested with **1.19** and **2.2** .
2014-10-29 21:09:00 +03:00
* **libwebp** provides the WebP format.
2013-10-09 04:13:06 +04:00
2013-11-30 22:06:21 +04:00
* Pillow has been tested with version **0.1.3** , which does not read
2014-10-29 21:09:00 +03:00
transparent WebP files. Versions **0.3.0** and **0.4.0** support
2014-06-02 02:57:25 +04:00
transparency.
2013-10-09 04:13:06 +04:00
2014-06-02 02:57:25 +04:00
* **tcl/tk** provides support for tkinter bitmap and photo images.
2013-10-09 04:13:06 +04:00
2014-06-02 02:57:25 +04:00
* **openjpeg** provides JPEG 2000 functionality.
2014-04-01 21:52:52 +04:00
2014-06-02 23:22:45 +04:00
* Pillow has been tested with openjpeg **2.0.0** and **2.1.0** .
2014-04-01 21:52:52 +04:00
2014-07-05 22:50:37 +04:00
Once you have installed the prerequisites,run::
2013-10-09 04:13:06 +04:00
$ pip install Pillow
2014-07-05 22:50:37 +04:00
If the prerequisites are installed in the standard library locations
for your machine (e.g. :file: `/usr` or :file: `/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 :file: `setup.py` or
:file: `setup.cfg` , or by adding environment variables on the command
line::
$ CFLAGS="-I/usr/pkg/include" pip install pillow
2014-11-19 23:14:57 +03:00
Build Options
-------------
* Environment Variable: `` MAX_CONCURRENCY=n `` . By default, Pillow will
2014-12-09 02:56:07 +03:00
use multiprocessing to build the extension on all available CPUs,
2014-12-08 22:15:44 +03:00
but not more than 4. Setting `` MAX_CONCURRENCY `` to 1 will disable
parallel building.
2014-11-19 23:14:57 +03:00
* Build flags: `` --disable-zlib `` , `` --disable-jpeg `` ,
`` --disable-tiff `` , `` --disable-freetype `` , `` --disable-tcl `` ,
`` --disable-tk `` , `` --disable-lcms `` , `` --disable-webp `` ,
`` --disable-webpmux `` , `` --disable-jpeg2000 `` . 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-tcl `` ,
`` --enable-tk `` , `` --enable-lcms `` , `` --enable-webp `` ,
`` --enable-webpmux `` , `` --enable-jpeg2000 `` . 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.
Sample Usage::
2015-04-03 15:37:44 +03:00
$ MAX_CONCURRENCY=1 python setup.py build_ext --enable-[feature] install
2014-11-19 23:14:57 +03:00
2015-03-18 12:19:32 +03:00
OS X Installation
-----------------
2013-10-09 04:13:06 +04:00
2015-03-18 12:46:54 +03:00
We provide binaries for OS X in the form of `Python Wheels <http://wheel.readthedocs.org/en/latest/index.html> `_ . Alternatively you can compile Pillow from soure with XCode.
2013-10-09 04:13:06 +04:00
2014-07-04 23:22:30 +04:00
The easiest way to install external libraries is via `Homebrew <http://mxcl.github.com/homebrew/> `_ . After you install Homebrew, run::
2013-10-09 04:13:06 +04:00
2014-04-13 02:28:26 +04:00
$ brew install libtiff libjpeg webp little-cms2
2013-10-09 04:13:06 +04:00
2014-07-04 23:22:30 +04:00
Install Pillow with::
2013-10-09 04:13:06 +04:00
$ pip install Pillow
2015-03-18 12:19:32 +03:00
Windows Installation
2013-10-09 04:13:06 +04:00
--------------------
We provide binaries for Windows in the form of Python Eggs and `Python Wheels
<http://wheel.readthedocs.org/en/latest/index.html> `_:
Python Eggs
^^^^^^^^^^^
.. note ::
:command: `pip` does not support Python Eggs; use :command: `easy_install`
instead.
::
$ easy_install Pillow
Python Wheels
^^^^^^^^^^^^^
2015-03-18 12:46:54 +03:00
.. Note :: Requires setuptools >=0.8 and pip >=1.4.1. Some older versions of pip required the `` --use-wheel `` flag.
2013-10-09 04:13:06 +04:00
::
2015-03-18 12:39:01 +03:00
$ pip install Pillow
2013-10-09 04:13:06 +04:00
2014-03-22 03:19:51 +04:00
If the above does not work, it's likely because we haven't uploaded a
wheel for the latest version of Pillow. In that case, try pinning it
to a specific version:
::
2015-03-18 12:39:01 +03:00
$ pip install Pillow==2.6.1
2014-03-22 03:19:51 +04:00
2015-03-18 12:19:32 +03:00
FreeBSD Installation
--------------------
2014-06-02 02:57:25 +04:00
.. Note :: Only FreeBSD 10 tested
Make sure you have Python's development libraries installed.::
$ sudo pkg install python2
Or for Python 3::
$ sudo pkg install python3
Prerequisites are installed on **FreeBSD 10** with::
$ sudo pkg install jpeg tiff webp lcms2 freetype2
2015-04-04 15:26:34 +03:00
Linux Installation
------------------
.. note ::
Most major Linux distributions, including Fedora, Debian/Ubuntu and ArchLinux include Pillow in packages that previously contained PIL e.g. `` python-imaging `` . Please consider using native operating system packages first to avoid installation problems and/or missing library support later.
**We do not provide binaries for Linux.** If you didn't build Python from
source, make sure you have Python's development libraries installed. In Debian
or Ubuntu::
$ sudo apt-get install python-dev python-setuptools
Or for Python 3::
$ sudo apt-get install python3-dev python3-setuptools
In Fedora, the command is::
$ sudo yum install python-devel
Prerequisites are installed on **Ubuntu 12.04 LTS** or **Raspian Wheezy
7.0** with::
$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
Prerequisites are installed on **Ubuntu 14.04 LTS** with::
$ sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
Prerequisites are installed on **Fedora 20** with::
$ sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
lcms2-devel libwebp-devel tcl-devel tk-devel
2014-06-02 02:57:25 +04:00
2014-03-22 03:19:51 +04:00
2015-04-18 01:00:53 +03:00
Platform Support
2013-10-09 04:13:06 +04:00
----------------
Current platform support for Pillow. Binary distributions are contributed for
each release on a volunteer basis, but the source should compile and run
everywhere platform support is listed. In general, we aim to support all
current versions of Linux, OS X, and Windows.
.. note ::
2015-04-04 15:20:48 +03:00
Contributors please test Pillow on your platform then update this document and send a pull request.
2013-10-09 04:13:06 +04:00
2014-06-02 02:57:25 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2013-10-09 04:13:06 +04:00
|**Operating system** |**Supported** |**Tested Python versions** |**Tested Pillow versions** |**Tested processors** |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2015-08-30 14:17:06 +03:00
| Mac OS X 10.10 Yosemite |Yes | 2.7,3.3,3.4 | 2.8.1,2.9 |x86-64 |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-11-19 23:15:14 +03:00
| Mac OS X 10.9 Mavericks |Yes | 2.7,3.4 | 2.6.1 |x86-64 |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-11-19 23:15:14 +03:00
| Mac OS X 10.8 Mountain Lion |Yes | 2.6,2.7,3.2,3.3 | |x86-64 |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Redhat Linux 6 |Yes | 2.6 | |x86 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-01-12 22:33:00 +04:00
| CentOS 6.3 |Yes | 2.7,3.3 | |x86 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Fedora 20 |Yes | 2.7,3.3 | 2.3.0 |x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Ubuntu Linux 10.04 LTS |Yes | 2.6 | 2.3.0 |x86,x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-11-19 23:15:14 +03:00
| Ubuntu Linux 12.04 LTS |Yes | 2.6,2.7,3.2,3.3,PyPy2.4, | 2.6.1 |x86,x86-64 |
| | | PyPy3,v2.3 | | |
2014-01-12 22:33:00 +04:00
| | | | | |
2014-11-19 23:15:14 +03:00
| | | 2.7,3.2 | 2.6.1 |ppc |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-11-19 23:15:14 +03:00
| Ubuntu Linux 14.04 LTS |Yes | 2.7,3.2,3.3,3.4 | 2.3.0 |x86 |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-01-12 22:33:00 +04:00
| Raspian Wheezy |Yes | 2.7,3.2 | 2.3.0 |arm |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Gentoo Linux |Yes | 2.7,3.2 | 2.1.0 |x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-06-02 02:57:25 +04:00
| FreeBSD 10 |Yes | 2.7,3.4 | 2.4,2.3.1 |x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2013-10-14 13:54:18 +04:00
| Windows 7 Pro |Yes | 2.7,3.2,3.3 | 2.2.1 |x86-64 |
2013-10-09 04:13:06 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Windows Server 2008 R2 Enterprise|Yes | 3.3 | |x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
| Windows 8 Pro |Yes | 2.6,2.7,3.2,3.3,3.4a3 | 2.2.0 |x86,x86-64 |
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-04-02 20:53:30 +04:00
| Windows 8.1 Pro |Yes | 2.6,2.7,3.2,3.3,3.4 | 2.3.0, 2.4.0 |x86,x86-64 |
2014-03-20 12:32:09 +04:00
+----------------------------------+-------------+------------------------------+------------------------------+-----------------------+
2014-07-03 15:33:26 +04:00
Old Versions
------------
You can download old distributions from `PyPI <https://pypi.python.org/pypi/Pillow> `_ . Only the latest 1.x and 2.x releases are visible, but all releases are available by direct URL access e.g. https://pypi.python.org/pypi/Pillow/1.0.