Python/Tk not working in Linux

2006-08-11 Thread BinnyVA
I am using Fedora Core 3 Linux and I have a problem with Tk in Python.
Whenever I try to run a tk script, I get the error...

---
Traceback (most recent call last):
File "Tk.py", line 1, in ?
from Tkinter import *
File "/usr/local/lib/python2.4/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
---

I get this error with even the most basic Python/Tk scripts like

---
from Tkinter import *

class Application(Frame):
def createWidgets(self):
self.lab = Label(text="Hello World")
self.lab.pack()

def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()

app = Application()
app.mainloop()
--

However python script that does not used Tk works fine.

I have tried to solve this problem by reinstalling Python from source -
but still no luck. Ruby also fails this way in my system - ruby works -
but not Ruby with Tk. However Perl/Tk and Tcl/Tk works fine.

Any suggestions?

--
Binny V A
http://www.bin-co.com/perl/perl_tk_tutorial/ - Perl/Tk
http://www.bin-co.com/tcl/tutorial/ - Tcl/Tk

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python/Tk not working in Linux

2006-08-13 Thread BinnyVA
> Some distributions move the
> `Tkinter` stuff into an own package.  Search for a package called
> `python-tk` or `python-tkinter` or similar.

I could use a 'python-tk' package - but the problem is the latest
version of python may not be available.

I am going to download Tcl/Tk and install it. Then I would try to
install Python once again. If that works, great. If not I will install
a full 'python-tk' package. Maybe
'ActivePython'(http://www.activestate.com/Products/Download/Download.plex?id=ActivePython)
like Cameron Laird have suggested.

-- 
Binny V A
http://www.bin-co.com/ - Bin-Co

-- 
http://mail.python.org/mailman/listinfo/python-list