I have a Python 2.7 project that looks like this:
myproject\
- __init__.py - __main__.py - foo.py
I'd like to use absolute imports, as required by PEP 8, but when I try to do this in __main__
.py:
from myproject.foo import bar
With python -m myproject
I get:
ImportError: No module named myproject.foo
What am I doing wrong?