On Wednesday 27 August 2003 9:12 pm, Rob Andrews wrote:
I'm on a Red Hat 9 system, which has Python 2.2.2 installed, and I
installed 2.3 separately into /home/rob/Python-2.3/ (creating the symbolic
link "py23" to point to my 2.3 installation). Now I'm trying to work out
the kinks in the process.

Unable to run Idle using 2.3 the way I've got things set up, I created a
super simple Tkinter test program that just pops up a Label widget. I
pasted below an example of how the RH-provided 2.2 runs the script without
incident, but running the script with 2.3 produces a traceback. If someone
can help me see the error of my ways, I'll be most appreciative.

[Wed Aug 27][03:01 PM] ~/Python-2.3/test $ python -V
Python 2.2.2
[Wed Aug 27][03:04 PM] ~/Python-2.3/test $ py23 -V
Python 2.3
[Wed Aug 27][03:01 PM] ~/Python-2.3/test $ py23 test2.py
Traceback (most recent call last):
File "test2.py", line 1, in ?
from Tkinter import Label
File "/home/rob/Python-2.3/Lib/lib-tk/Tkinter.py", line 38, in ?
import _tkinter # If this fails your Python may not be configured for
Tk ImportError: No module named _tkinter
[Wed Aug 27][03:01 PM] ~/Python-2.3/test $ python test2.py

(mediocre with Python, incompetent with linux)


I had another look and I think I see your problem... basically I removed the
/usr/local build of Tcl/Tk so that python 2.3 would 'find' the redhat 9 build
of Tcl/Tk....

so I ran configure then make and right at the end of the make:-

building '_tkinter' extension
gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-fno-strict-aliasing -DWITH_APPINIT=1 -I/usr/X11R6/include -I.
-I/usr/python/Python23/TEST111/Python-2.3 -c
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c -o
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c:96:2: #error
"unsupported Tcl configuration"
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c: In function
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c:947: warning:
passing arg 1 of `Tcl_NewUnicodeObj' from incompatible pointer type
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c: In function
/usr/python/Python23/TEST111/Python-2.3/Modules/_tkinter.c:1073: warning:
passing arg 1 of `PyUnicodeUCS2_FromUnicode' from incompatible pointer type

So it looks like the Tcl/Tk version that comes with RedHat 9 (it apears to be
Tk 8.3.5 accordfing to the tk.h file in /usr/include) is not compatible with
the Tkinter in Python 2.3. This means _tkinter.so is not built and Tkinter
will not work!

On way round this little problem would be to build your own Tcl/Tk
(thats what I did) Not only will you get a working Python 2.3 but you get the
new options in Tk 8.4 too all for an extra couple of downloads and about 30
mins of 'work'.


Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 8 | next ›
Discussion Overview
grouppython-list @
postedAug 27, '03 at 8:12p
activeSep 2, '03 at 9:41a



site design / logo © 2022 Grokbase