Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 9th, 2004, 11:25 AM
irishtek irishtek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29 irishtek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to irishtek Send a message via AIM to irishtek Send a message via Yahoo to irishtek
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.

Reply With Quote
  #2  
Old February 9th, 2004, 11:56 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
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

Reply With Quote
  #3  
Old February 9th, 2004, 02:01 PM
irishtek irishtek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29 irishtek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to irishtek Send a message via AIM to irishtek Send a message via Yahoo to irishtek
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

Reply With Quote
  #4  
Old February 9th, 2004, 03:56 PM
irishtek irishtek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Tucson AZ
Posts: 29 irishtek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to irishtek Send a message via AIM to irishtek Send a message via Yahoo to irishtek
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > py2exe problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway