473,219 Members | 2,014 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,219 software developers and data experts.

Problem using Py2exe

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
  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 10197
6,596 Expert 4TB
Here is a link to true911m's Simple guide to using py2exe.
Dec 18 '06 #2
195 100+
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/env python
  2. from distutils.core import setup
  3. import py2exe
  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
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
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
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
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

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- and ActivePython-2.2.1-222. In the sample below, commenting out...
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...
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...
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...
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 ############## ...
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 (''), matplotlib ('0.83.2'), win32com (latest?), Numeric...
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....
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
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...
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...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.