The following forum message was posted by at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4551200:
Hello,
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.
mymod1.py:
[code]myattr = 42[/code]
mymod2.py:
[code]from .mymod1 import *[/code]
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.
Thanks,
Amnon
|