Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I'm getting an unresolved import in the following scenario: I have a package 'mypackage' with two modules 'mymod1' and 'mymod2', the contents of which are as follows.
myattr = 42
from .mymod1 import *
The error states:
"Unresolved import: mymod1"
However, if I remove the dot in my import statement, the import is resolved successfully. Obviously this can cause ambiguity, if I were to have a module named 'mymod1' in the root package.
I've searched the forum, if a duplicate topic exists I apologize in advance.
I forgot to mention my configuration:
* Eclipse 3.6.1
* PyDev 126.96.36.19910404
* Python 2.7 grammar, 2.7.1 interpreter
It's really a bug (please report it in the bug tracker - I'll take a look at why the relative import is having issues with wildcard imports).
Thanks Fabio, I've reported the bug:
Hey again Fabio,
Thanks for addressing this issue. I've just updated to 2.2.0, and a notion of this issue yet remains unresolved.
As a continuation to the example in my first message, suppose you have a deeper package "mypackage.deeper", and within it a python module "mymod3", the following code still causes an error ("Undefined variable: myattr"):
from ..mymod1 import *