Importing a Python file that is at the same level

in «tip» by Michael Beard
Tags: , ,

This almost always messes me up in some way.

The important part is that you need to have the existence of a __init__.py file to tell Python 2.7 that it should treat the directory as a package. Then you can import from it.

Sigh.

I got that from how to import relative file.

Hopefully, this will help me remember.