views:

59

answers:

1

I've been using Eclipse with PyDev (on Windows, mind you) for my Python Tkinter project for about a month now, and up until recently I've had no complaints. I start the source for one module (my GUI) like so:

from Tkinter import *

Now, ever since I updated Eclipse to 3.6.1, it shows an error for every call to the Tkinter module(Frame(), Label(), Tk(), etc.). I thought that something might have gone wrong during the update, so I uninstalled Eclipse, re-downloaded it (Eclipse 3.6.1 Classic), and reinstalled it. Then, seeing that that gave me a bunch of errors with installing PyDev, I removed that, got Eclipse 3.6.0 Classic, installed it, and got the same problem I was trying to fix earlier.

I don't understand what's wrong here. It doesn't make any sense to me why all of a sudden Eclipse would stop recognizing that I had imported Tkinter.

Can anyone offer any suggestions/input? I really want to stick with Eclipse, I'm very happy with it, but I can't deal with it giving me about 200 bogus errors.

+2  A: 

You really shouldn't use wild imports. Consider from Tkinter import Frame, Label or import Tkinter as tk instead.

Now to your problem: I have Eclipse Helios, too (3.6.0.v20100602). The problem you describe clearly has to do with PyDev, not with the Eclipse base project. I just tried the same import and didn't get error messages. My PyDev version also retrieves the docstring of Frame correctly, for example.

I think it boils to just installing a newer version of PyDev (this is the solution for many bugs ^^) - add "http://pydev.org/nightly" as an update site and then upgrade to the latest version. I have version 1.6.3.20100922, by the way. If that doesn't help, you should consider reporting it as a bug.

AndiDog
On the wild import subject---I use virtually every class in Tkinter. It makes sense to have a wild import. And on the update---I had PyDev installed using the update sites feature. Anyway, I'll try using nightly builds.
Rafe Kettler
@Rafe Kettler: I disagree that it makes sense. I think if you do "import Tkinter as tk ... tk.Frame(...)" it makes your code more self-documenting. It leaves no question as to when you're calling a Tk function and when you're not.
Bryan Oakley