Create a Python package and a script that uses it:
foo/__init__.py:
foo/bar.py:
def baz():
print 'foo.bar.baz'
test.py:
from foo.bar import baz
baz()
Running python test.py outputs foo.bar.baz, as expected.
Running pytype test.py produces an error: File "test.py", line 1, in <module>: Can't find module 'foo.bar'. [import-error]
Create a Python package and a script that uses it:
foo/__init__.py:
# (empty)foo/bar.py:
test.py:
Running
python test.pyoutputsfoo.bar.baz, as expected.Running
pytype test.pyproduces an error:File "test.py", line 1, in <module>: Can't find module 'foo.bar'. [import-error]