4

我昨天更新了 PyDev (Eclipse),现在它告诉我 None、name和其他保留字/内置函数无效,但脚本运行得很好。我在这个论坛上读到这个问题涉及错误地导入内置插件。我曾尝试更改解释器并重新添加它,但没有运气。有人可以帮我吗?

错误:

未定义变量main 未定义变量 None 未定义变量 int 未定义变量 eval

我正在运行 eclipse Juno 和 PyDev 2.7.4。另外,我注意到错误仅在 PyDev 代码分析结束后出现。

4

2 回答 2

4

这也发生在我身上,问题是eclipse找不到python。

我的修复:

在 Eclipse 中:

窗口 > 首选项 > PyDev > 解释器 - Python

这里的设置是空白的。我点击了“自动配置”,它向我建议了 python 的路径。我选择了它,重新启动了eclipse,问题就解决了。

于 2013-06-25T11:39:23.017 回答
1

Well, I see nobody has come up with some idea. I found out by myself so I'm posting how I solved it here; maybe it'll help somebody:

The problem was that I had recently changed my local machine's name, but PyDev was still looking for localhost when it tried to connect to the Python Shell. I just updated the files in my operating system containing the hostname, and voila (the automatic wizard did not update all the files for some reason, so I had to do it manually).

于 2013-06-04T05:22:43.880 回答