newbie: help please!

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Wed Jun 19 08:38:29 EDT 2002


----- Original Message -----
From: "Steve" <steve.bond at btinternet.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, June 19, 2002 5:20 AM
Subject: newbie: help please!


> hello,
>
> i have python 2.2.1 installed on my mandrake 8.1 system, which seems to
> work fine.
>
> The problem is im trying to install Tk exstensions, i have downloaded both
> tcl8.3.4 and tk8.3.4 files and installed using the ./configure, make and
> then make install commands. I then when into the setup file in the
> Python-2.2.1/Modules directory where i understand i have to enable the
> tkinter extension module, by uncommenting the approritae lines.
>
> Lastly i run 'make' at the top of my Python-2.2.1 directory but i get this
> error:
>
> gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include
> -DHAVE_CONFIG_H   -DWITH_APPINIT -I/usr/local/include -I/usr/X11R6/bin -c
> ./Modules/_tkinter.c -o Modules/_tkinter.o
> In file included from ./Modules/_tkinter.c:49:
> /usr/include/tk.h:83:29: X11/Xlib.h: No such file or directory
>
> i have the Xlib.h in the Python-2.2.1/Include directory
>
> the tkinter part of my setup file looks like this and everything was
> installed in the default places

The standard Python 2.2 configuration system should automatically add tk
support if all components are there.  Your error is because you don't have
the X11 development RPM(s) installed.  Get out your Mandrake install set
and add any RPM's which are specifically for X11 development (I run SuSE
so I don't know what RPM's you need for Mandrake).

The Xlib.h in the Python-2.2.1/Include directory isn't the right one.  You
need the X11 version.

>
> # *** Always uncomment this (leave the leading underscore in!):
>  _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
> # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
>         -L/usr/local/lib \
> # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
>         -I/usr/local/include \
> # *** Uncomment and edit to reflect where your X11 header files are:
>         -I/usr/X11R6/bin \

X11 header files are conventionally in /usr/X11R6/include or in
/usr/include/X11, and on many distro's both exist, one being a link to the
other.  /usr/X11R6/bin is almost certainly NOT the right location.

> # *** Or uncomment this for Solaris:
> #       -I/usr/openwin/include \
> # *** Uncomment and edit for Tix extension only:
> #       -DWITH_TIX -ltix8.1.8.2 \
> # *** Uncomment and edit for BLT extension only:
> #       -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
> # *** Uncomment and edit for PIL (TkImaging) extension only:
> #     (See http://www.pythonware.com/products/pil/ for more info)
> #       -DWITH_PIL -I../Extensions/Imaging/libImaging  tkImaging.c \
> # *** Uncomment and edit for TOGL extension only:
> #       -DWITH_TOGL togl.c \
> # *** Uncomment and edit to reflect your Tcl/Tk versions:
>         -ltk8.3 -ltcl8.3 \
> # *** Uncomment and edit to reflect where your X11 libraries are:
>         -L/usr/X11R6/lib \
> # *** Or uncomment this for Solaris:
> #       -L/usr/openwin/lib \
> # *** Uncomment these for TOGL extension only:
> #       -lGL -lGLU -lXext -lXmu \
> # *** Uncomment for AIX:
> #       -lld \
> # *** Always uncomment this; X11 libraries to link with:
>         -lX11
>
> Any help would be much appreciated!

Install the missing RPM's and correct your setup file as noted, and
all should build fine.

> Thanks

You're welcome.  Hope this helps.

Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net
http://newcenturycomputers.net






More information about the Python-list mailing list