4

I'm trying to convert my Python programs with the Py2exe library with the following setup.py code below:

    from distutils.core import setup
    import py2exe

    file = raw_input("Python file to convert:")

    setup(console=[file]) 

Then, when I enter in the program I want to convert, it says:

    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
        or: setup.py --help [cmd1 cmd2 ...]
        or: setup.py --help-commands
        or: setup.py cmd --help

    error: no commands supplied

And then it stops. Do any of you know what could be causing this?

I.A.S.
  • 81
  • 2
  • 11

2 Answers2

2

You can try

python setup.py install
python_pardus
  • 310
  • 2
  • 5
  • 14
0

I got the same error as the original poster. I couldn't get py2exe working, even on a toy hello world-style script. However: This worked for me: PyInstaller, more instructions here: How to make a Python script standalone executable to run without ANY dependency?

If it expects arguments, it should take them like this: put this inside the python script:

import sys
thisArg = sys.argv[1]

make sure you call it in command prompt with the arguments:

my_script "argument1"

Note, no .py at the end.

argv[0] is self, the script name itself.

Vince Hall
  • 46
  • 1
  • 6