jeudi 5 novembre 2015

.exe doesn't launch after making it with py2exe

Vote count: 0

So I have been working for 2 months on a project in python (it is the first time I'm using python). The project is basically: - 1 main file, - 1 GUI file using PyQt4 - and a few classes for the calculation functions.

Here is my setup.py file:

from distutils.core import setup
import py2exe
from glob import glob
import matplotlib

dataf = [
        (r'mpl-data', 
          [r'C:\Python27\Lib\site-packages\matplotlib-1.4.3-py2.7-win32.egg\matplotlib\mpl-data\matplotlibrc']),
        (r'mpl-data\stylelib',
          glob(r'C:\Python27\Lib\site-packages\matplotlib-1.4.3-py2.7-win32.egg\matplotlib\mpl-data\stylelib\*.*')),
        (r'mpl-data\images',
          glob(r'C:\Python27\Lib\site-packages\matplotlib-1.4.3-py2.7-win32.egg\matplotlib\mpl-data\images\*.*')),
        (r'mpl-data\fonts',
          glob(r'C:\Python27\Lib\site-packages\matplotlib\mpl-data\fonts\*.*')),
        (r'Qt\imageformats',
          glob(r'C:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\*.*')),
        (r'Resource',
          glob(r'C:\PythonWS\Lince5M\*.png')),
    ]

includes = ['sip', 'PyQt4.QtCore', 'PyQt4.Qt', 'PyQt4.QtGui', 'PyQt4.QtNetwork',]
pack = ['numpy.core', 'matplotlib.backends', 'matplotlib.axes', 'zmq', 'PyQt4.QtCore', 'PyQt4.Qt', 
    'PyQt4.QtGui', 'PyQt4.QtNetwork', 'CaptureImage', 'ClusterDetectionIterative', 'DisplayPanel', 
    'ImageProcessAvg', 'WriteOutputFiles',
    ]
excludes = ['_gtkagg', '_agg2', '_cairo', '_cocoaagg', '_fltkagg', '_gtk', '_gtkcairo', '_thread', 
        '_macosx',
        ]
#I admit not understand really much those excludes, that's why I don't put them in the setup

opts={
'py2exe': {
        'compressed': 2,
        'optimize': 2,
        'includes':includes,
        'packages':pack,
        #'excludes':excludes,
        'dist_dir': 'ANAFOCUS_Lince5M-3',
        'bundle_files': 1,
    }
}

win = [{
      'script': 'Application.py', 
      'icon_resourses': [(1,'icone\icone.png')]
   }
]

setup(
    name = 'ANAFOCUS_Lince5M-3',
    description = 'Anafocus test program for Lince5M-3',
    version = "0.1",
    console=win,
    options=opts,
    data_files=dataf,
    )

My programs works fine when launched with Eclipse.

The making of the executable seems to be done fine too, except for the list of missing modules there is no error, and my .exe is created...

But when I start it nothing happens... I have been looking for a few days now and I really have no idea on what is wrong since nothing gives me a notice on the problem..

If it could be of any use, my project uses those imports: PyQt4, os, decimal, time, numpy, sys, clr, matplotlib, cv2, and a dll we made in the company.

So here is my question:

  1. Anyone ever got this kind of error?
  2. Does any one know how to get an output, or anything that could tell me where is the problem?
asked 2 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



.exe doesn't launch after making it with py2exe

Aucun commentaire:

Enregistrer un commentaire