Eclipse PyDev现在显示所有引用Tkinter作为错误 [英] Eclipse PyDev now shows all references to Tkinter as errors

查看:189
本文介绍了Eclipse PyDev现在显示所有引用Tkinter作为错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Python Tkinter项目中一直在使用Eclipse和PyDev(在Windows上,介绍一下),直到最近,我没有抱怨。我启动一个模块(我的GUI)的源代码:

 从Tkinter import * 

自从我将Eclipse更新为3.6.1以来,它向每个Tkinter模块的调用显示错误( Frame() Label() Tk()等)。我以为在更新过程中可能出了问题,所以我卸载了Eclipse,重新下载了它(Eclipse 3.6.1 Classic)并重新安装了它。然后,看到那个安装PyDev给我一些错误,我删除了,安装了Eclipse 3.6.0 Classic,并且遇到了同样的问题,我正在尝试修复。



我不明白这里有什么问题。对于我来说,为什么所有的突然的Eclipse都不会意识到我已经导入了Tkinter,所以没有任何意义。



任何人都可以提供任何建议/输入?我真的想坚持使用Eclipse,我很高兴,但我无法处理它给我大概200个假的错误。

解决方案

你真的不应该使用wild import。请考虑从Tkinter导入框架,标签或导入Tkinter作为tk c

现在你的问题:我也有Eclipse Helios(3.6.0.v20100602)。你所描述的问题清楚地与PyDev有关,而不是Eclipse基础项目。我只是尝试了相同的导入,没有收到错误消息。我的PyDev版本也会正确检索 Frame 的文本字符串。



我认为只需安装一个更新版本的PyDev(这是许多错误的解决方案^^) - 添加http://pydev.org/nightly作为更新站点,然后升级到最新版本。我有版本1.6.3.20100922,顺便说一句。如果没有帮助,您应该考虑将其报告为错误。


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.

解决方案

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.

这篇关于Eclipse PyDev现在显示所有引用Tkinter作为错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆