473,657 Members | 2,594 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.framewor k/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.framewor k/Versions/2.3/lib/python2.3/lib-tk/*inter*
-rw-r--r-- 1 root wheel 154289 13 Sep 2003 /System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/python2.3/lib-tk/Tkinter.py
-rw-r--r-- 1 root wheel 262073 13 Sep 2003 /System/Library/Frameworks/Python.framewor k/Versions/2.3/lib/python2.3/lib-tk/Tkinter.pyc
-rw-r--r-- 1 root wheel 262073 13 Sep 2003 /System/Library/Frameworks/Python.framewor k/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 2227
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.framewor k/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.framewor k/Versions/2.3/lib/python2.3/lib-tk/*inter*

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

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

-rw-r--r-- 1 root wheel 262073 13 Sep 2003
/System/Library/Frameworks/Python.framewor k/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
23528
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 are the main criteria. thanks, leo
3
2332
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, QuickTimeMovie, that would wrap up the QuickTimeTcl Tcl extension as a Python class. All seems to work pretty fine until the Tkinter application is closed, when the Python interpreter crashes with an error of the following kind: The instruction at...
0
2150
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 created as a .pyw why does it still show a Command Prompt box when I run the .exe??? I can’t figure it out. If anyone at all could help ill be very grateful ;) Steve Oh and p.s. is it also possible to make a button in python (Tkinter) that when...
14
2671
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 most frustrating, as there is no friendly traceback to help me guess where its coming from.
1
14584
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 buttons something like Oval(or any other shape). I searched a lot.. But could'nt get. If any of you know please help me out. Thanks in advance.
2
2910
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 say 10th line, without inserting any '/n' before that line... For Example : text = Text(parent, height, width, .... ) # Creating Text widget inside its parent. text.insert(INSERT, "Hi\n") # inserting "Hi" in the first line ...
8
2017
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 World')
2
2545
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 XP, however, the same programs crash regularly. The crashes are not Python exceptions, but rather are reported by Windows as errors in pythonw.exe. (Of course, the error messages themselves contain absolutely no useful information.) This happens...
1
6209
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
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7321
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.