473,395 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem using Py2exe

Loismustdie129
195 100+
I need help with a py2exe example I am working on to get the basics. The example is:

Expand|Select|Wrap|Line Numbers
  1. # setup.py
  2. from distutils.core import setup
  3. import py2exe
  4. setup(name="wxTail",scripts=["wxTail.py"],)
I type this in and then I get the error message:

Expand|Select|Wrap|Line Numbers
  1. Traceback (most recent call last):
  2.   File "<pyshell#2>", line 1, in -toplevel-
  3.     setup(name="wxTail",scripts=["wxTail.py"],)
  4.   File "C:\Python24\lib\distutils\core.py", line 137, in setup
  5.     raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
  6. SystemExit: usage:  [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
  7.    or:  --help [cmd1 cmd2 ...]
  8.    or:  --help-commands
  9.    or:  cmd --help
  10.  
  11. error: no commands supplied
What I want to know is what does this mean and what is the Setup() command do.

Thanks for any help.
Dec 17 '06 #1
7 10224
bartonc
6,596 Expert 4TB
Here is a link to true911m's Simple guide to using py2exe.
Dec 18 '06 #2
Loismustdie129
195 100+
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/env python
  2. from distutils.core import setup
  3. import py2exe
  4.  
  5. setup(
  6.     console=["HelloWorld.py"],
  7.     zipfile=None
  8.      )
I tried this code out and I got an error message reading:

Traceback (most recent call last):
File "<pyshell#6>", line 3, in -toplevel-
zipfile= None
File "C:\Python24\lib\distutils\core.py", line 137, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: --help [cmd1 cmd2 ...]
or: --help-commands
or: cmd --help

error: no commands supplied
any thoughts on it?
Dec 20 '06 #3
bartonc
6,596 Expert 4TB
I tried this code out and I got an error message.
any thoughts on it?
It needs to be called from the commend line like this:
Expand|Select|Wrap|Line Numbers
  1. python setup.py py2exe --bundle 1
.
How did you invoke you script?
Dec 20 '06 #4
Loismustdie129
195 100+
I took that code and put it into my editor, IDLE, and when I hit enter to get out of the "setup" function it returned that error, I never saved anything cause of the error.
Dec 20 '06 #5
bartonc
6,596 Expert 4TB
I took that code and put it into my editor, IDLE, and when I hit enter to get out of the "setup" function it returned that error, I never saved anything cause of the error.
There's your problem. IDLE was never quite finished. The Run Module in the Run menu doesn't pass any command line arguments that way that other IDEs do. Follow all the steps in true911m's tutorial. His way uses a batch file to execute setup.py with arguments. This can also be done from a DOS command prompt, but changing directories in there becomes tedious (at best).
Dec 20 '06 #6
I created another walkthrough for PyInstaller if anyone would rather try that.
Dec 21 '06 #7
bartonc
6,596 Expert 4TB
I created another walkthrough for PyInstaller if anyone would rather try that.
You make this forum a smarter place. Thanks for your contributions!
Dec 21 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
1
by: Marc | last post by:
Hello, I've fiddled with this for quite a while and thought I had the problem solved. I had a version that would successfully compile and run. But then I had to change the code to use a...
5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
0
by: bapeterson | last post by:
I'd like to use PY2EXE to "compile" a program using the VPYTHON module (www.vpython.org). I have an example where this was previously done to the demo script: Hanoi.py (a towers of Hanoi demo) a...
5
by: Lad | last post by:
I try to make an exe file from my script with help of Py2exe but I am not successfull. I have my script start.py that has only one command ############### import rgs.py ############## ...
4
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric...
6
by: Michele Petrazzo | last post by:
Hi list, just found in this moment that my applications stop to work with win xp and receive this error: """ This application has requested the Runtime to terminate it in an unusual way....
1
by: Dave Lim | last post by:
>On May 3, 1:29 pm, Dave Lim <diband... at yahoo.com> wrote: site:http://surguy.net/articles/speechrecognition.xml used out tried ? to protection aroundhttp://mail.yahoo.com I went and
5
by: msunderwd | last post by:
Having a problem with "compiling" a Tkinter/python program using py2exe (and pyinstaller, for that matter)... I have several dialogs that are derived from the tkSimpleDialog.Dialog class. These...
3
by: Kevin | last post by:
Hi everyone, I'm running Python 2.5.1 on an XP-Pro platform, with all the updates (SP2, etc) installed. I have a program (send_file.py) that sends a file to a service provider, using an ftp...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.