473,509 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python+tkinter errors on OSX

Sp my latest adventure is attempting to use python's Tkinter module on a few machines.
On my PB (OSX 10.3.9), I got the following confusing results:

/Users/jc: python
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import Tkinter Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/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 ^D

/Users/jc: ls -l /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/*inter*
-rw-r--r-- 1 root wheel 154289 13 Sep 2003 /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.py
-rw-r--r-- 1 root wheel 262073 13 Sep 2003 /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.pyc
-rw-r--r-- 1 root wheel 262073 13 Sep 2003 /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.pyo
/Users/jc:

So I'm trying to discover what's going wrong here, and how to fix it.
It does appear that Tkinter has been "installed", in some weak sense
of the term. Under /System/Library/... there's a lib-tk directory, and
it contains some Tkinter.* files. Furthermore, python's import command
clearly looked there and did something with the expected Tkinter.py
file. But whatever it did was clearly not enough, because something
called "_tkinter" was expected but not found.

I also experimented with PATH and PYTHONPATH, to no apparent
effect on anything.

Anyone here know how to diagnose and/or fix this? What's it trying
to tell me? I have a feeling that it's there somewhere, but the proverbial
ducks aren't lined up quite right.

(Or maybe this isn't the right NG for such questions. If so, what might
be a better one?)
Jan 11 '06 #1
1 2212
John Chambers wrote:
Sp my latest adventure is attempting to use python's Tkinter module on a
few machines.
On my PB (OSX 10.3.9), I got the following confusing results:

/Users/jc: python
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import Tkinter Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/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 ^D

/Users/jc: ls -l
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/*inter*

-rw-r--r-- 1 root wheel 154289 13 Sep 2003
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.py

-rw-r--r-- 1 root wheel 262073 13 Sep 2003
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.pyc

-rw-r--r-- 1 root wheel 262073 13 Sep 2003
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.pyo

/Users/jc:

So I'm trying to discover what's going wrong here, and how to fix it.
It does appear that Tkinter has been "installed", in some weak sense
of the term. Under /System/Library/... there's a lib-tk directory, and
it contains some Tkinter.* files. Furthermore, python's import command
clearly looked there and did something with the expected Tkinter.py
file. But whatever it did was clearly not enough, because something
called "_tkinter" was expected but not found.

I also experimented with PATH and PYTHONPATH, to no apparent
effect on anything.

Anyone here know how to diagnose and/or fix this? What's it trying
to tell me? I have a feeling that it's there somewhere, but the proverbial
ducks aren't lined up quite right.

(Or maybe this isn't the right NG for such questions. If so, what might
be a better one?)

You probably don't have Tcl/Tk installed.

A package for 10.3 is available at http://tcltkaqua.sourceforge.net.

--
Cheers,

Kevin Walzer, PhD
WordTech Software - "Tame the Terminal"
http://www.wordtech-software.com
sw at wordtech-software.com
Jan 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
23512
by: Leo | last post by:
hi there for somebody who wants tostart small/medium GUI apps with python: what's the best toolkit: tkinter, wxPython or what? stability, ease of use and portability between mac and windows...
3
2313
by: Mickel Grönroos | last post by:
Hi everybody, I'm using QuickTimeTcl (3.1) to be able to play movie files in my Tkinter application (Python 2.3.2) on Windows 2000. I was planning to write a simple wrapper class,...
0
2143
by: SteveFerrigno | last post by:
Ok, firstly I’m really sorry if this is in the wrong place :( but anyway. I have created a program which I want to convert into a .exe so I use PY2EXE but even if I have saved the python file I...
14
2648
by: Hendrik van Rooyen | last post by:
Hi, I get the following: hvr@LINUXBOXMicrocorp:~/Controller/libpython display.py UpdateStringProc should not be invoked for type font Aborted and I am back at the bash prompt - this is...
1
14567
by: ShambhuHubli | last post by:
Hi ! I am developing front end for some application using Python Tkinter. And I am new to this GUI development. In my application, I have to create buttons other than square or rectangle. I want...
2
2901
by: ShambhuHubli | last post by:
Hi all ! I am developing GUI in Python Tkinter for one application. In this I have created one Text box. And I need to insert the text inside the text box directly in to some paticular line...
8
2012
by: Lie | last post by:
Inspect the following code: --- start of code --- import Tkinter as Tk from Tkconstants import * root = Tk.Tk() e1 = Tk.Entry(root, text = 'Hello World') e2 = Tk.Entry(root, text = 'Hello...
2
2532
by: Russell Blau | last post by:
I have some Tkinter programs that I run on two different machines. On Machine W, which runs Python 2.5.1 on Windows XP, these programs run fine. On Machine H, which runs Python 2.5.1 on Windows...
1
6203
by: alivip | last post by:
How to brows and select a directory of file by using python TKinter like brows to find attachment in email but I can select not only file but whole directory any help
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.