|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
py2exe problem
py2exe (0.50)
python (2.3.3) running py2exe on a script, no errors thrown and an executable is made. Executable does not work - it runs but no results occur and no errors are thrown. |
|
#2
|
||||
|
||||
|
irishtek,
A few suggestion in no particular order: 1. Try building the app as a console application and run it from an already open command window. See if anything is printed. 2. Sprinkle a few print statements in the main module to confirm its actually running Code:
if __name__ == "__main__":
print "Starting..."
#your code
print "Stopping"
3. Check the build logs - I use a modified standard script like this Code:
# setup.py # Requires py2exe has been installed that matches python version # Run this program "python release.py py2exe" to create an executable + dlls found in # c:/python21/dist/gscript. # see http://starship.python.net/crew/theller/py2exe/ for details. from distutils.core import setup import py2exe import glob import sys rd="c:\\tester" f = open(rd+'\\pybuild.log','w') sys.stdout = f setup( name="GSCRIPT", windows=[ { "script":rd+"\\gscript.pyw", "icon_resources":[(1,rd+"\\g.ico")] } ], data_files=[ ( ".",['gextension.py','pypdu.py','g.ico','w9xpopen.exe', "GSCRIPT.htm",'script.template', 'calldll.pyd','DLPORTIO.dll', 'DLPORTIO.sys'] +glob.glob("*.gsc") ), ( "GSCRIPT_files",glob.glob(rd+"\\GSCRIPT_files\\*.gif") +glob.glob(rd+"\\GSCRIPT_files\\*.jpg") +glob.glob(rd+"\\GSCRIPT_files\\*.png") ), ( r"ftp", glob.glob(rd+"\\ftp\\*.*") ), ], ) f.close() to write a log file. I then use a batch file: Code:
c:\python23\python py2exe setup.py notepad pybuild.log 4. Make sure you don't just pass exceptions Let us know how you get on. not so Grim ![]() |
|
#3
|
|||
|
|||
|
it appears to be an issue with the image library.
If compiled and executed from DOS I see the following error: Starting... Traceback (most recent call last): File "<string>", line 164, in ? File "<string>", line 129, in MakeText File "Image.pyc", line 1571, in open IOError: cannot identify image file Works fine as a py script - fails as an exe |
|
#4
|
|||
|
|||
|
In order to make PIL and PY2EXE work together all libraries of PIL need to be imported such as:
import Image import BmpImagePlugin also the py2exe line needs to be: python setup.py py2exe -pPIL |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > py2exe problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|