[D]python打包出错,求高手指点Python codefrom distutils.core import setupimport py2exesetup(console[
[D]python打包出错,求高手指点
Python codefrom distutils.core import setup import py2exesetup(console=["ziyou.py"])
Traceback (most recent call last):
File "C:\Python27\新建文件夹\游戏\打包.py", line 4, in <module>
setup(console=["ziyou.py"])
File "C:\Python27\lib\distutils\core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: 打包.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: 打包.py --help [cmd1 cmd2 ...]
or: 打包.py --help-commands
or: 打包.py cmd --help
error: no commands supplied
-------------------------------
Double行动:
原帖分数:40
帖子加分:40
[解决办法]http://hekun06.blogbus.com/logs/20426007.html
[解决办法]要在命令行里运行python setup.py py2exe,不是直接在调试器里面运行的,这个应该没搞错吧!
下面是出错函数parse_command_line的注释:
Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py).
如果还不行的话,检查一下你的py2exe版本和python是不是匹配,或者重新安装
如果还不行的话,试试PyInstaller。
[解决办法]6楼不是告诉你了,要在命令行里运行python setup.py py2exe,红色那个字就是参数,教程上应该有呀,估计你没输入这个参数也没认真看错误信息...