Unable to install Python Imaging Library

P

peter.mosley

A few weeks ago I asked for advice about which GUI toolkit I should
learn, and receved several helpful answers. In the end I went with
Tkinter. This was because a) it was already installed on the machines
I am most likley to use, b) it is cross platform, and c) it was not as
complex as PyGtk - which I tried and was totally unable to decipher.

I am now at the point of trying to import the Python Imaging Library,
and I have reached a total standstill. I downloaded a copy of Python
Imaging Library 1.1.5 Source Kit from the site
http://www.pythonware.com/products/pil/. There did not seem to be any
prebuilt binaries suitable for my system (Python 2.2/Fedora Core 1), so
I loaded the source code.

The instructions said to try 'python setup.py install', followed by
more detailed instructions 'If you prefer to know what you're doing'. I
do prefer to know what I'm doing, but couldn't understand the following
instructions. So I tried the simple route, but it failed with the
output shown below.

I have absolutely no idea how to proceed. Can anyone point me in the
right direction to get over this hurdle?


gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC
-fPIC -I/usr/include/freetype2 -IlibImaging -I/usr/include
-I/usr/local/include -I/usr/include/python2.2 -c _imagingtk.c -o
build/temp.linux-i686-2.2/_imagingtk.o
_imagingtk.c:20:16: tk.h: No such file or directory
_imagingtk.c:23: error: syntax error before '*' token
_imagingtk.c:31: error: syntax error before "Tcl_Interp"
_imagingtk.c:31: warning: no semicolon at end of struct or union
_imagingtk.c:32: warning: data definition has no type or storage class
_imagingtk.c: In function `_tkinit':
_imagingtk.c:37: error: `Tcl_Interp' undeclared (first use in this
function)
_imagingtk.c:37: error: (Each undeclared identifier is reported only
once
_imagingtk.c:37: error: for each function it appears in.)
_imagingtk.c:37: error: `interp' undeclared (first use in this
function)
_imagingtk.c:45: error: syntax error before ')' token
_imagingtk.c:50: error: `app' undeclared (first use in this function)
_imagingtk.c:50: error: syntax error before ')' token
_imagingtk.c: At top level:
_imagingtk.c:55: warning: parameter names (without types) in function
declaration
_imagingtk.c:55: error: conflicting types for `TkImaging_Init'
_imagingtk.c:23: error: previous declaration of `TkImaging_Init'
_imagingtk.c:55: warning: data definition has no type or storage class
_imagingtk.c:57: error: syntax error before '&' token
error: command 'gcc' failed with exit status 1
 
F

Fredrik Lundh

I have absolutely no idea how to proceed. Can anyone point me in the
right direction to get over this hurdle?


gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC
-fPIC -I/usr/include/freetype2 -IlibImaging -I/usr/include
-I/usr/local/include -I/usr/include/python2.2 -c _imagingtk.c -o
build/temp.linux-i686-2.2/_imagingtk.o
_imagingtk.c:20:16: tk.h: No such file or directory

the setup procedure has determined that your Python has been built with
Tkinter, and that Tcl/Tk libraries and include files seem to be available, but
the compiler cannot find them, for some unknown reason.

have you tried installing the Tcl and Tk development libraries ? (usually
tcl-devel and tk-devel)

if you have, look for lines similar to the following

--- using Tcl/Tk libraries at /usr/local
--- using Tcl/Tk version 8.4

in the output from the setup script, and make sure that you have the Tcl/Tk
libraries and include files at that location (look in the lib and include directories).

</F>
 
P

peter.mosley

Thanks for that reply.

I hadn't tried installing the Tcl and Tk development libraries -
because I had no idea these that these were necessary (or that they
even existed!). My first attempt to do so was a total failure, as I
downloaded the RPM files from http://rpmfind.net, but immediately
entered a dependency hell. My next attempt was a little more thought
out - I looked for the appropriate files on some Fedora Core 1
distribution discs, and to my surprise found them. To my even greater
surprise, I could load these without problems and then the PIL install
ran smoothly.

So thanks to your hint I have got there. Much appreciated.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top