I simplified my import problems to this simple basic option. Say I have a Python package:
mypkg/
__init__.py
a.py
b.py
a.py contains:
def echo(msg):
return msg
b.py contains:
from mypkg import a
print(a.echo())
The launch python b.pycreates ImportError: No module named mypkgboth in Python 2.7.6 and Python 3.3.5. I also tried to add from __future__ import absolute_importthe same problem in both cases.
Expected:
I expect 1 to work fine.
Why I want to do this:
2 . a ( , ). Python 2 , Python 3+ , .
, , 1 , ? , .
. script mypkg, from mypkg import a .
python - , , .