In bar.py foo is imported # bar.py from path import foo In my current file bar is imported and I use the get_id function of foo: from path import bar bar.foo.get_id() Mypy is complaining error: Module "bar" does not explicitly export attribute "foo" [attr-defined] Continue reading...