I am trying to convert a Python project to exe using py2exe. My project directory structure is:
project/
__init__.py
main.py
src/
__init__.py
interface/
__init__.py
window.py
secondary.py
ui/
settings.ui
icons/
project.png
In main.py
, there is import src.interface.window as win
statement, when I try to create exe using py2exe, it shows an error message: The following modules appear to be missing: [src.interface.window]
. I don't know how to include all the modules in setup script so that distutils
can recognize them.
My setup script:
import py2exe
from distutils.core import setup
setup(packages=['project.src.interface'],
package_data={'project': ['ui/*', 'icons/*']},
windows=[{'script': 'project/main.py'}],
options={'py2exe': {'skip_archive': True, 'includes': ['sip', 'pgmagick', 'PyQt4.QtGui', 'PyQt4.QtCore']}})