4

当我尝试使用 easy_install 添加新库时,我的 PyDev 表现得非常奇怪。事实上,我确信我之前处理过这个确切的问题,但不确定我是如何做到的。

我在 aptana studio 中设置了一个 PyDev 项目,并重新配置了 python 解释器。完成此操作后,我清理了项目,代码分析开始在一个文件上挂起很长时间。

它最终会完成,但它会将几乎所有内置类型标记为错误,例如“dict”或“list”,表示未定义变量。

我有一个相当大的代码库,我喜欢经常重构,所以我需要能够利用 PyDev 的代码分析功能,但它显然不起作用。

我认为该解决方案与强制内置函数有关,但我还没有发现任何真正有用的东西。

有什么帮助吗?

4

1 回答 1

2

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).

于 2011-06-29T16:31:37.050 回答