官术网_书友最值得收藏!

Installation prerequisites

Before we jump in to the main chapter, it is necessary to install the following packages.

Python

In this book we will use Python Version 2.6, or to be more specific, Version 2.6.4. It can be downloaded from the following location: http://python.org/download/releases/

Windows platform

For Windows, just download and install the platform-specific binary distribution of Python 2.6.4.

Other platforms

For other platforms, such as Linux, Python is probably already installed on your machine. If the installed version is not 2.6, build and install it from the source distribution. If you are using a package manager on a Linux system, search for Python 2.6. It is likely that you will find the Python distribution there. Then, for instance, Ubuntu users can install Python from the command prompt as:

$sudo apt-get python2.6

Note that for this, you must have administrative permission on the machine on which you are installing Python.

Python Imaging Library (PIL)

We will learn image-processing techniques by making extensive use of the Python Imaging Library (PIL) throughout this chapter. As mentioned in Chapter 1, PIL is an open source library. You can download it from http://www.pythonware.com/products/pil/. Install the PIL Version 1.1.6 or later.

Windows platform

For Windows users, installation is straightforward—use the binary distribution PIL 1.1.6 for Python 2.6.

Other platforms

For other platforms, install PIL 1.1.6 from the source. Carefully review the README file in the source distribution for the platform-specific instructions. Libraries listed in the following table are required to be installed before installing PIL from the source. For some platforms like Linux, the libraries provided in the OS should work fine. However, if those do not work, install a pre-built "libraryName-devel" version of the library. For example, for JPEG support, the name will contain "jpeg-devel-", and something similar for the others. This is generally applicable to rpm-based distributions. For Linux flavors like Ubuntu, you can use the following command in a shell window.

$sudo apt-get install python-imaging.

However, you should make sure that this installs Version 1.1.6 or later. Check PIL documentation for further platform-specific instructions. For Mac OSX, see if you can use fink to install these libraries. See http://www.finkproject.org/ for more details. You can also check the website http://pythonmac.org or Darwin ports website http://darwinports.com/ to see if a binary package installer is available. If such a pre-built version is not available for any library, install it from the source.

The PIL prerequisites for installing PIL from source are listed in the following table:

PyQt4

This package provides Python bindings for Qt libraries. We will use PyQt4 to generate GUI for the image-processing application that we will develop later in this chapter. The GPL version is available at: http://www.riverbankcomputing.co.uk/software/pyqt/download.

Windows platform

Download and install the binary distribution pertaining to Python 2.6. For example, the executable file's name could be 'PyQt-Py2.6-gpl-4.6.2-2.exe'. Other than Python, it includes everything needed for GUI development using PyQt.

Other platforms

Before building PyQt, you must install SIP Python binding generator. For further details, refer to the SIP homepage: http://www.riverbankcomputing.com/software/sip/.

After installing SIP, download and install PyQt 4.6.2 or later, from the source tarball. For Linux/Unix source, the filename will start with PyQt-x11-gpl-.. and for Mac OS X, PyQt-mac-gpl-... Linux users should also check if PyQt4 distribution is already available through the package manager.

Summary of installation prerequisites

主站蜘蛛池模板: 赤壁市| 即墨市| 商丘市| 车险| 图片| 平顶山市| 大田县| 塘沽区| 仪陇县| 宁波市| 西宁市| 邹平县| 陇川县| 克山县| 和政县| 盖州市| 长垣县| 盐亭县| 彩票| 三河市| 泗洪县| 铜梁县| 肃宁县| 和硕县| 游戏| 前郭尔| 杨浦区| 固始县| 昌乐县| 闽侯县| 鄂州市| 郴州市| 光山县| 乳山市| 泗阳县| 永和县| 西青区| 湟源县| 崇州市| 友谊县| 乌鲁木齐市|