Python 3.2.2, error(scripts to exe)

主宰稳场 提交于 2020-01-04 13:41:51

问题


Hello i follow this instructions (How can I use the py2exe to change the python3.2's code to exe) to create exe form python scripts(version 3.2.2), but it report me an error:

Traceback (most recent call last):
  File "C:\Python32\Scripts\setup.py", line 7, in <module>
    executables = [Executable("ochranka.py")])
  File "C:\Python32\lib\site-packages\cx_Freeze\dist.py", line 365, in setup
    distutils.core.setup(**attrs)
  File "C:\Python32\lib\distutils\core.py", line 136, in setup
    raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
SystemExit: 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

This is my setup.py file:

from cx_Freeze import setup, Executable
setup(
    name = "Ochranka",
    version = "1.0",
    description = "test",
    executables = [Executable("ochranka.py")])

I am a beginner, I do not know what to do with it.


回答1:


You have to pass a command to setup.py; in this case, build*:

python setup.py build

I bet you forgot the build part.

*Note: I'm not 100% sure build is the command you want (it's been a while since I used cx_freeze). See the documentation.



来源:https://stackoverflow.com/questions/14820461/python-3-2-2-errorscripts-to-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!