Python Py2exe错误:未提供任何命令
我正在尝试使用Py2exe库转换Python程序,代码如下:Python Py2exe错误:未提供任何命令,python,py2exe,setup.py,Python,Py2exe,Setup.py,我正在尝试使用Py2exe库转换Python程序,代码如下: from distutils.core import setup import py2exe file = raw_input("Python file to convert:") setup(console=[file]) 然后,当我进入要转换的程序时,它会显示: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_op
from distutils.core import setup
import py2exe
file = raw_input("Python file to convert:")
setup(console=[file])
然后,当我进入要转换的程序时,它会显示:
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
然后它停止了。你们知道是什么原因造成的吗?你们可以试试
python setup.py install
我的错误和原来的海报一样。 我无法让py2exe工作,即使是在一个玩具hello world风格的脚本上。 然而: 这对我有用:PyInstaller,更多说明如下: 如果它需要参数,则应如下所示: 将其放入python脚本中:
import sys
thisArg = sys.argv[1]
确保在命令提示符下使用以下参数调用它:
我的剧本“argument1”
注意,结尾没有.py
argv[0]是self,即脚本名称本身 尝试
python setup.py py2exe