简体   繁体   中英

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']
        }
    }
)

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 *

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM