Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
PyDev appears to be incorrectly parsing a file (with Grammar Version set to 3.0) with the 2.* rules for local imports. I'm posting here to make sure this isn't a known issue; if I get the OK, I'll post an issue in the bug tracker.
To reproduce, set up a project with this relationship:
-> foo.py (Contains:
-> math.py (empty file)
If foo.py attempts to "import math", PyDev thinks that the interpreter is going to import pkg.math, instead of the built in math module. This is correct in Python 2.*, but is no longer the case in 3.* (see PEP 328 here http://www.python.org/dev/peps/pep-0328/). Because of this error, any uses of the math symbol within foo.py, such getting the .pi attribute, gets tagged with an "Undefined variable from import" error. Auto-completion and go to definition functionality is also broken.
As a fix, when a PyDev project is in 3.0 Grammar mode, it should always use absolute paths in imports except when using the dot syntax (from .math import something).
Yeap, seems like a bug to me. Please report it in the bugtracker (you can reference this thread if you want).
I just encountered this apparently as a consequence of updating to pydev version 184.108.40.2061082312.
I have been using Version 220.127.116.111062419 for a few months without trouble. It has been good enough for my purposes. I have been searching for an archive site so I could download/update the version that works for well enough for me. I haven't found one yet. Is there such a site?
The update site (http://pydev.org/updates) has archives (in the install dialog you have an option to show old versions).
I never had to use the archives before now, which says a lot.
Just to note, I'm working on this issue now, so, if you wait until tomorrow, there should be a nightly build with this fixed.