28
28
format support, an efficient internal representation, and powerful
29
29
image processing capabilities.
31
This source kit has been built and tested on Windows NT/2000/XP, Mac
32
OS X, and most major Unix platforms (including Alpha, Solaris, and
33
Intel systems). We believe that it should work on most modern
34
platforms (people are using it on Crays, after all ;-)
31
This source kit has been built and tested with Python 2.0 and newer,
32
on Windows, Mac OS X, and major Unix platforms. Large parts of the
33
library also work on 1.5.2 and 1.6.
36
35
The main distribution site for this software is:
155
153
http://www.gzip.org/zlib/
157
OpenType/TrueType freetype2 (2.1.3 or later is recommended)
155
OpenType/TrueType freetype2 (2.3.9 or later is recommended)
159
157
http://www.freetype.org
160
158
http://freetype.sourceforge.net
162
If you have a recent Linux version, the libraries provided with
163
the operating system usually work just fine. If some library is
160
CMS support littleCMS (1.1.5 or later is recommended)
162
http://www.littlecms.com/
164
If you have a recent Linux version, the libraries provided with the
165
operating system usually work just fine. If some library is
164
166
missing, installing a prebuilt version (jpeg-devel, zlib-devel,
165
etc) is usually easier than building from source.
167
etc) is usually easier than building from source. For example, for
168
Ubuntu 9.10 (karmic), you can install the following libraries:
170
sudo apt-get install libjpeg62-dev
171
sudo apt-get install zlib1g-dev
172
sudo apt-get install libfreetype6-dev
173
sudo apt-get install liblcms1-dev
167
175
If you're using Mac OS X, you can use the 'fink' tool to install
168
176
missing libraries (also see the Mac OS X section below).
170
Similar tools are available for many other platforms (such as
171
'apt-get' for Debian).
178
Similar tools are available for many other platforms.
174
181
2. To build under Python 1.5.2, you need to install the stand-alone
177
184
http://www.python.org/sigs/distutils-sig/download.html
186
You can fetch distutils 1.0.2 from the Python source repository:
188
svn export http://svn.python.org/projects/python/tags/Distutils-1_0_2/Lib/distutils/
179
190
For newer releases, the distutils library is included in the
180
191
Python standard library.
193
NOTE: Version 1.1.7 is not fully compatible with 1.5.2. Some
194
more recent additions to the library may not work, but the core
195
functionality is available.
183
198
3. If you didn't build Python from sources, make sure you have
184
199
Python's build support files on your machine. If you've down-
185
200
loaded a prebuilt package (e.g. a Linux RPM), you probably
186
201
need additional developer packages. Look for packages named
187
"python-devel", "py-dev", or similar.
202
"python-dev", "python-devel", or similar. For example, for
203
Ubuntu 9.10 (karmic), use the following command:
205
sudo apt-get install python-dev
190
208
4. When you have everything you need, unpack the PIL distribution
191
(the file Imaging-1.1.6.tar.gz) in your Python extensions
192
directory (if you have one, that is. If not, feel free to
193
unpack it in any other suitable directory).
209
(the file Imaging-1.1.7.tar.gz) in a suitable work directory:
195
$ cd Python-2.4/Extensions # example
196
$ gunzip Imaging-1.1.6.tar.gz
197
$ tar xvf Imaging-1.1.6.tar
211
$ cd MyExtensions # example
212
$ gunzip Imaging-1.1.7.tar.gz
213
$ tar xvf Imaging-1.1.7.tar
200
216
5. Build the library. We recommend that you do an in-place build,
201
217
and run the self test before installing.
204
220
$ python setup.py build_ext -i
205
221
$ python selftest.py
207
When the build finishes, a summary report is shown. Make sure
208
that the optional components you need are included.
210
----------------------------------------------------------------
211
PIL 1.1.6 BUILD SUMMARY
212
----------------------------------------------------------------
213
*** TKINTER support not available (Tcl/Tk 8.3 libraries needed)
215
--- ZLIB (PNG/ZIP) support ok
216
--- FREETYPE support ok
217
----------------------------------------------------------------
223
During the build process, the setup.py will display a summary
224
report that lists what external components it found. The self-
225
test will display a similar report, with what external components
226
the tests found in the actual build files:
228
----------------------------------------------------------------
229
PIL 1.1.7 SETUP SUMMARY
230
----------------------------------------------------------------
231
*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
232
--- JPEG support available
233
--- ZLIB (PNG/ZIP) support available
234
--- FREETYPE support available
235
----------------------------------------------------------------
237
Make sure that the optional components you need are included.
219
239
If the build script won't find a given component, you can edit the
220
240
setup.py file and set the appropriate ROOT variable. For details,
221
241
see instructions in the file.
243
If the build script finds the component, but the tests cannot
244
identify it, try rebuilding *all* modules:
246
$ python setup.py clean
247
$ python setup.py build_ext -i
224
250
6. If the setup.py and selftest.py commands finish without any
225
251
errors, you're ready to install the library:
254
280
(usually /MD, under Visual Studio).
257
Note that most Python distributions include libraries compiled for
258
Microsoft Visual Studio. To build extensions using other tool chains,
259
see the "Using non-Microsoft compilers on Windows" section in the
262
http://www.python.org/doc/current/inst/non-ms-compilers.html
283
Note that most Python distributions for Windows include libraries
284
compiled for Microsoft Visual Studio. You can get the free Express
285
edition of Visual Studio from:
287
http://www.microsoft.com/Express/
289
To build extensions using other tool chains, see the "Using
290
non-Microsoft compilers on Windows" section in the distutils handbook:
292
http://www.python.org/doc/current/inst/non-ms-compilers.html
264
294
For additional information on how to build extensions using the
265
295
popular MinGW compiler, see:
267
http://mingw.org (compiler)
268
http://sebsauvage.net/python/mingw.html (build instructions)
269
http://sourceforge.net/projects/gnuwin32 (prebuilt libraries)
297
http://mingw.org (compiler)
298
http://sebsauvage.net/python/mingw.html (build instructions)
299
http://sourceforge.net/projects/gnuwin32 (prebuilt libraries)