Search code examples
pythonpy2exedistutils

py2exe executes file but doesn't attempt to build


My question is rather simple: if I try to build my .exe using:

python setup.py py2exe

Python just executes my main file, starting my application, however py2exe doesn't try to build it. Meaning: it does the same as if I'd do:

python setup.py

I guess something is wrong with the distutil?

Anybody already encountered this problem?

py2exe is installed (I reinstalled it, hoping it'd fix it).

My Code:

from testmain import *
from Initfile import *
import math
import py2exe
import matplotlib
import PyQt4
import numpy
from distutils.core import setup

setup(
    windows=['Initfile.py'],
    data_files=[("GUI", ["testmain.ui"]),*matplotlib.get_py2exe_datafiles()],
    options = {
        'py2exe': {
            'includes' : ['math','py2exe','numpy','matplotlib','PyQt4']
        }
    }
)

Solution

  • Well the error isn't within distutil, it seems when one imports the entry point itself (in my case Initfile.py) pyexe isnt executing. So the solution is: remove the line from Initfile import *