473,416 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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 2207
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.