Eclipse PyDev 抛出错误错误
- 作者: 硪比迩妈还爱伱
- 来源: 51数据库
- 2023-01-29
问题描述
我昨天更新了 PyDev (Eclipse),现在它告诉我 None、name 和其他保留字/内置函数无效,但脚本运行良好.我在这个论坛上读到这个问题涉及错误地导入内置插件.我曾尝试更改解释器并重新添加它,但没有运气.有人可以帮帮我吗?
I updated PyDev (Eclipse) yesterday and now it is telling me that None, name and other reserved words/builtin functions are invalid, but the script runs just fine. I have read on this forum that the problem deals with incorrectly importing the built-ins. I have tried changing the interpreter and re-adding it but no luck. Can somebody help me please?
错误:
未定义变量ma??in未定义变量 无未定义变量 int未定义变量评估
Undefined variable main Undefined variable None Undefined variable int Undefined variable eval
我正在运行 eclipse Juno 和 PyDev 2.7.4.另外,我注意到错误仅在 PyDev 代码分析结束后出现.
I am running eclipse Juno and PyDev 2.7.4. also, I notice that the errors only appear after the PyDev code analysis ends.
推荐答案
好吧,我看到没有人提出一些想法.我自己发现了,所以我在这里发布了我是如何解决的;也许它会帮助某人:
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:
问题是我最近更改了本地机器的名称,但 PyDev 在尝试连接到 Python Shell 时仍在寻找 localhost.我刚刚更新了操作系统中包含主机名的文件,瞧(自动向导由于某种原因没有更新所有文件,所以我不得不手动进行).
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).