Pydev Undefined Variable "list"
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 ne开发者_StackOverflowed 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?
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).
精彩评论