2
--------------------------------------------------------------------
3
Build instructions (all platforms)
4
--------------------------------------------------------------------
6
For a list of changes in this release, see the CHANGES document.
8
0. If you're in a hurry, try this::
10
$ tar xvfz Imaging-1.1.7.tar.gz
12
$ python setup.py install
14
If you prefer to know what you're doing, read on.
19
If you need any of the features described below, make sure you
20
have the necessary libraries before building PIL.
22
+----------------------+---------------------------------------------+
24
+----------------------+---------------------------------------------+
25
| JPEG support |libjpeg (6a or 6b) |
27
| |http://www.ijg.org |
28
| |http://www.ijg.org/files/jpegsrc.v6b.tar.gz |
29
| |ftp://ftp.uu.net/graphics/jpeg/ |
30
+----------------------+---------------------------------------------+
32
| PNG support |zlib (1.2.3 or later is recommended) |
34
| |http://www.gzip.org/zlib/ |
35
+----------------------+---------------------------------------------+
37
| OpenType/TrueType |freetype2 (2.3.9 or later is recommended) |
39
| |http://www.freetype.org |
40
| |http://freetype.sourceforge.net |
41
+----------------------+---------------------------------------------+
43
| CMS support |littleCMS (1.1.5 or later is recommended) |
44
| |http://www.littlecms.com/ |
45
+----------------------+---------------------------------------------+
47
If you have a recent Linux version, the libraries provided with the
48
operating system usually work just fine. If some library is
49
missing, installing a prebuilt version (jpeg-devel, zlib-devel,
50
etc) is usually easier than building from source. For example, for
51
Ubuntu 9.10 (karmic), you can install the following libraries::
53
sudo apt-get install libjpeg62-dev
54
sudo apt-get install zlib1g-dev
55
sudo apt-get install libfreetype6-dev
56
sudo apt-get install liblcms1-dev
58
If you're using Mac OS X, you can use the 'fink' tool to install
59
missing libraries (also see the Mac OS X section below).
61
Similar tools are available for many other platforms.
64
2. To build under Python 1.5.2, you need to install the stand-alone
65
version of the distutils library:
67
http://www.python.org/sigs/distutils-sig/download.html
69
You can fetch distutils 1.0.2 from the Python source repository:
71
svn export http://svn.python.org/projects/python/tags/Distutils-1_0_2/Lib/distutils/
73
For newer releases, the distutils library is included in the
74
Python standard library.
76
NOTE: Version 1.1.7 is not fully compatible with 1.5.2. Some
77
more recent additions to the library may not work, but the core
78
functionality is available.
81
3. If you didn't build Python from sources, make sure you have
82
Python's build support files on your machine. If you've down-
83
loaded a prebuilt package (e.g. a Linux RPM), you probably
84
need additional developer packages. Look for packages named
85
"python-dev", "python-devel", or similar. For example, for
86
Ubuntu 9.10 (karmic), use the following command:
88
sudo apt-get install python-dev
91
4. When you have everything you need, unpack the PIL distribution
92
(the file Imaging-1.1.7.tar.gz) in a suitable work directory::
94
$ cd MyExtensions # example
95
$ gunzip Imaging-1.1.7.tar.gz
96
$ tar xvf Imaging-1.1.7.tar
99
5. Build the library. We recommend that you do an in-place build,
100
and run the self test before installing::
103
$ python setup.py build_ext -i
106
During the build process, the setup.py will display a summary
107
report that lists what external components it found. The self-
108
test will display a similar report, with what external components
109
the tests found in the actual build files::
111
--------------------------------------------------------------------
112
Pillow 1.5 ( PIL fork based on PIL 1.1.7 ) SETUP SUMMARY
113
--------------------------------------------------------------------
114
platform darwin 2.6.6 (r266:84292, Nov 26 2010, 16:24:16)
115
[GCC 4.2.1 (Apple Inc. build 5664)]
116
--------------------------------------------------------------------
117
--- TKINTER support available
118
--- JPEG support available
119
--- ZLIB (PNG/ZIP) support available
120
*** FREETYPE2 support not available
121
*** LITTLECMS support not available
122
--------------------------------------------------------------------
124
Make sure that the optional components you need are included.
126
If the build script won't find a given component, you can edit the
127
setup.py file and set the appropriate ROOT variable. For details,
128
see instructions in the file.
130
If the build script finds the component, but the tests cannot
131
identify it, try rebuilding *all* modules::
133
$ python setup.py clean
134
$ python setup.py build_ext -i
137
6. If the setup.py and selftest.py commands finish without any
138
errors, you're ready to install the library::
140
$ python setup.py install
142
(depending on how Python has been installed on your machine,
143
you might have to log in as a superuser to run the 'install'
144
command, or use the 'sudo' command to run 'install'.)
147
Additional notes for Mac OS X
148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
On Mac OS X you will usually install additional software such as
151
libjpeg or freetype with the "fink" tool, and then it ends up in
152
"/sw". If you have installed the libraries elsewhere, you may have
153
to tweak the "setup.py" file before building.
156
Additional notes for Windows
157
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159
On Windows, you need to tweak the ROOT settings in the "setup.py"
160
file, to make it find the external libraries. See comments in the
163
Make sure to build PIL and the external libraries with the same
164
runtime linking options as was used for the Python interpreter
165
(usually /MD, under Visual Studio).
168
Note that most Python distributions for Windows include libraries
169
compiled for Microsoft Visual Studio. You can get the free Express
170
edition of Visual Studio from:
172
http://www.microsoft.com/Express/
174
To build extensions using other tool chains, see the "Using
175
non-Microsoft compilers on Windows" section in the distutils handbook:
177
http://www.python.org/doc/current/inst/non-ms-compilers.html
179
For additional information on how to build extensions using the
180
popular MinGW compiler, see:
182
http://mingw.org (compiler)
183
http://sebsauvage.net/python/mingw.html (build instructions)
184
http://sourceforge.net/projects/gnuwin32 (prebuilt libraries)