Added another case to Michał Górny's answer:
Note that relative imports are based on the name of the current module. Since the name of the main module is always "main__main__", modules intended for use as the main module of a Python application must always use absolute imports.
Added another case to Michał Górny's answer:
Note that relative imports are based on the name of the current module. Since the name of the main module is always "main", modules intended for use as the main module of a Python application must always use absolute imports.
Added another case to Michał Górny's answer:
Note that relative imports are based on the name of the current module. Since the name of the main module is always "__main__", modules intended for use as the main module of a Python application must always use absolute imports.
Added another case to Michał Górny's answer:
Note that relative imports are based on the name of the current module. Since the name of the main module is always "main", modules intended for use as the main module of a Python application must always use absolute imports.