Pydev 未定义变量“列表”
时不时地,当我尝试使用 easy_install 添加新库时,我的 PyDev 表现得非常奇怪。事实上,我确信我以前处理过这个确切的问题,但不确定我是如何做到的。
我在 aptana studio 中设置了一个 PyDev 项目,并重新配置了 python 解释器。完成此操作后,我清理了项目,代码分析就开始在一个文件上停留很长时间。
它最终确实完成了,但它将几乎所有内置类型标记为错误,例如“dict”或“list”,表示未定义的变量。
我有一个相当大的代码库,我喜欢经常重构,所以我需要能够利用 PyDev 的代码分析功能,但它显然不起作用。
我认为该解决方案与强制内置有关,但我还没有发现任何真正有用的东西。
有什么帮助吗?
Every now and then when I try to add a new library using easy_install, my PyDev acts incredibly strange. In fact, I am certain I dealt with this exact issue before, but am unsure how I did it.
I have a PyDev project set up in aptana studio, and I reconfigured the python interpreter. Once I did this, I cleaned the project and code analysis just starts hanging on one file for a long time.
It does eventually finish, but it marks almost all of the builtin types as errors, such as "dict" or "list", saying undefined variable.
I have a fairly large codebase that I like to frequently refactor, so I need to be able to leverage PyDev's code analysis feature, but it's obviously not working.
I think the solution has something to do with forced builtins, but I've found nothing really useful there yet.
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,现在,每当您安装新库时,您都必须再次在 PyDev 中手动添加解释器配置的路径(通常删除当前解释器并再次添加会更容易)。
之后,它应该可以工作,如果不行,你可以尝试重新启动 Eclipse(即:如果它不工作,那是一个错误,并且有一些过时的缓存,在这种情况下重新启动它肯定会清除你的缓存 - 如果你可以重现该问题,请输入错误报告,因为实际上不需要此步骤)。
如果您仍然有内置类型标记为错误(即:找不到字典或列表),则意味着 PyDev 无法生成 shell 来检查内置类型,在这种情况下,通常意味着有一些防火墙阻止了该类型通信(如果是这样,通常错误日志中会有条目 - 请参阅: http://pydev.org/ faq.html#when_i_do_a_code_completion_pydev_hangs_what_can 了解更多详情)。
Unfortunately, right now, whenever you install a new library, you have to manually add the path to your interpreter configuration in PyDev again (usually it's easier just removing the current interpreter and adding it again).
After that, it should work, if it doesn't, you can try restart eclipse (i.e.: if it doesn't work it's a bug and there's some stale cache, in which case restarting it would definitely clear your caches -- if you can reproduce that, please enter a bug report as this step shouldn't really be needed).
If you still have builtin types marked as errors (i.e.: can't find dict or list), it means that PyDev wasn't able to spawn a shell to inspect the builtins, in which case it usually means that there's some firewall blocking that communication (if so, usually there are entries in your error log -- see: http://pydev.org/faq.html#when_i_do_a_code_completion_pydev_hangs_what_can for more details).