My structure of file is
foo/
__init__.py
bar.py
file __init__.py
def abc():
print 'ABC'
file bar.py
from foo import abc
I got this error.
Traceback (most recent call last):
File "foo/bar.py", line 1, in <module>
from foo import abc
ImportError: No module named foo
Use a relative import (requires Python 2.6 or greater):
from . import abc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With