Suppose I have following files
tata/foo.py
tata/yoyo.py
foo/__init__.py
foo/bar.py
In file foo.py
I do
import foo.bar
I run PYTHONPATH=. python tata/yoyo.py
and I get
Traceback (most recent call last):
File "tata/yoyo.py", line 1, in <module>
import foo.bar
ImportError: No module named bar
Issue disappears when I delete tata/foo.py
. Could you please suggest a way to resolve my situation when I have global module name and local file name coincides.