Relative import error with py2exe

It seems that in your mf3.py you are importing beyond the top level. Let’s suppose that your project structure is as follows: folder/ main.py mod/ __init__.py components/ __init__.py expander.py language_id.py utilities/ __init__.py functions.py First make sure that main.py refers to the subpackages as: from mod.components.expander import * from mod.utilities.functions import * expander.py and language_id.py have … Read more

Relative imports – ModuleNotFoundError: No module named x

TL;DR: You can’t do relative imports from the file you execute since __main__ module is not a part of a package. Absolute imports – import something available on sys.path Relative imports – import something relative to the current module, must be a part of a package If you’re running both variants in exactly the same … Read more