Relative import error with py2exe
问题 I was trying to generate an executable for a simple Python script. My setup.py code looks like this: from distutils.core import setup import py2exe setup(console=["script.py"]) However, I am getting the error shown in the screenshot. Is there something I could try to fix this? I am using Windows 10. 回答1: 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