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:
myattr = 42
mymod2.py:
from.mymod1import*
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-05-30
I forgot to mention my configuration:
* Eclipse 3.6.1
* PyDev 2.0.0.20110404
* Python 2.7 grammar, 2.7.1 interpreter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-06-27
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..mymod1import*print([u]myattr[/u])
Thanks again,
Amnon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
mymod2.py:
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
I forgot to mention my configuration:
* Eclipse 3.6.1
* PyDev 2.0.0.20110404
* 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).
Cheers,
Fabio
Thanks Fabio, I've reported the bug:
https://sourceforge.net/tracker/?func=detail&aid=3309758&group_id=85796&atid=577329
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"):
Thanks again,
Amnon