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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old January 3rd, 2004, 10:25 AM
Nick889 Nick889 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 Nick889 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Nick889
Py2exe?? Error: Nothing to do?

I am trying to turn one of my .py files into an exe and I created a setup script and everything, but when i do the follwing "python myscript.py py2exe" I get an error saying "Error: Nothing to do"

What did i do wrong and how do i fix it, thanks.

Reply With Quote
  #2  
Old January 3rd, 2004, 12:53 PM
Boceifus's Avatar
Boceifus Boceifus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 90 Boceifus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 14 m 17 sec
Reputation Power: 5
because you didnt point to the setup.py file...i think.im still pretty new to,but i think your setup.py is what needs to be targeted.like for me,on a winxp machine,i opened a cmd prompt and changed to the directory of my setup.py(i keep myscript.py in there to) then did:
python23\python.exe setup.py py2exe

if you want to add a custom icon, add the line "icon_file=YourIconName.ico" to your setup.py and run this:
python23\python.exe setup.py py2exe --icon "path\to\icon\file"

hope that helps.if not,check out the stuff on the py2exe page.scroll down to "using py2exe".also on that page,near the bottom,it lists the flags
__________________
It is not important if the glass is half full or half empty.What is important,is who has been drinking from MY glass?!?!?

Reply With Quote
  #3  
Old January 3rd, 2004, 03:31 PM
Nick889 Nick889 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 Nick889 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Nick889
ok, now i got another problem.

I did manage to get it into an exe, thanks very much for helping me. When i run the .py file as normally, it works just fine, but for some reason the .exe file just gives me an error, i didnt move anything around after it created the files and stuff, i just click on it and this is what i got...

warning: name 'st' is assigned to before global declaration
Traceback (most recent call last):
File "imputil.pyc", line 106, in _import_hook
ImportError: No module named warnings

yet like i said, it still works if i run it when its .py, so why wouldnt it work when its an exe??

Reply With Quote
  #4  
Old January 3rd, 2004, 06:45 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 18 m 50 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Basically what seems to be going on is py2exe hasnt incuded the warning module. probably since there was no need for it before py2exe compiled it.

You could try telling py2exe to import the warnings module using the -i flag. Also, i don't know if this works with py2exe, i have a feeling it does, but you could try turning warnings off.

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #5  
Old January 3rd, 2004, 07:47 PM
Nick889 Nick889 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 6 Nick889 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Nick889
Thanks for replying, I was just now coming here to post that I didnt need any more help, but thank you anyways. I did manage to figure it out on my own according to a common error in py2exe, so i used "--force-imports warnings" on it and got it to work.

Also i figured out how to do the icon thing, but according to py2exe's website it can only be done on XP. I am using win98 but i can use my brothers computer for that. If there is a to specify an icon on win98 that would be great, if not, dont stress your self because most likely I will either figure it out my self with google searches or just use my bro's computer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Py2exe?? Error: Nothing to do?


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 4 hosted by Hostway