Frage

So I ran py2exe with a piece of code like

from distutils.core import setup
import py2exe

setup(console=['WorkingPSI_J.py'])

and the console did everything it should have (I don't seem to have any errors). Afterward however I got no build or distribution folders. Did I miss something simple? Thanks in advance.

edit:

    Traceback (most recent call last):
  File "C:\Python27\untitled-22.py", line 4, in <module>
    setup(console=['WorkingPSI_J.py'])
  File "C:\Python27\lib\distutils\core.py", line 140, in setup
    raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: untitled-22.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: untitled-22.py --help [cmd1 cmd2 ...]
   or: untitled-22.py --help-commands
   or: untitled-22.py cmd --help

I noticed upon running it a second time that it tells me it's 'skipping' a lot of things. Does anyone know how to fix that sort of issue?

War es hilfreich?

Lösung

Your problem is that you are trying to compile your script using IDLE. When you are using py2exe, you have to do it a little bit different.

If you've used Disutils before, you might have seen this:

python setup.py install

The same way you're using py2exe. So type in cmd:

python untitled-22.py py2exe 

And it should work. BTW I recommend you reading this tutorial at py2exe.org.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top