Before you can use tree2image, you will need Python (version 2.0 or higher) and the Python Image Library (PIL).
To check whether you have an appropriate version of Python, run Python -V:
$ python -V Python 2.1.1
If you need to install a new version of Python, see the Python download page.
To check if you have the Python Image Library installed, run Python and try importing "Image," "ImageFont", and "ImageDraw":
$ python Python 2.4.4 (#2, Jan 13 2007, 17:50:26) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Image, ImageFont, ImageDraw >>>
If you need to install the Python Image Library, see the Python Image Library download page
Finally, you will need at least one PIL font (the default font used by tree2image is helvR08.pil). Note that the Python Image Library package does not include any fonts. The two easiest ways to get fonts are:
Each font consists of a .pil file and a .pbm file. To install a set of font files:
[root /root]# mkdir /usr/lib/python2.1/site-packages/pilfonts [root pilfonts]# cd /usr/lib/python2.1/site-packages/pilfonts [root pilfonts]# wget http://effbot.org/pil/pilfonts.zip [root pilfonts]# unzip pilfonts.zip unzip ../pilfonts.zip Archive: ../pilfonts.zip inflating: courB08.pil inflating: courB10.pil inflating: courB12.pil . . . [root pilfonts]# rm pilfonts.zip [root pilfonts]# echo "pilfonts" > ../pilfonts.pth
Once you have Python and PIL installed, installing tree2image is simple.