The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
py2exe problem
Discuss py2exe problem in the Python Programming forum on Dev Shed. py2exe problem Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 9th, 2004, 11:25 AM
|
|
Junior Member
|
|
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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.
|

February 9th, 2004, 11:56 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
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 
|

February 9th, 2004, 02:01 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|

February 9th, 2004, 03:56 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|