[英]py2exe cmd failure
i wrote a python script and installed py2exe 0.6.9 (win32) to a 32bit-Windows7 machine with Python 2.7. 我编写了一个python脚本,并将py2exe 0.6.9(win32)安装到具有python 2.7的32位Windows7计算机上。 I could successfully run "python setup.py py2exe" via cmd.
我可以通过cmd成功运行“ python setup.py py2exe”。 Now I installed py2exe 0.6.9 (win64) to a 2nd PC (Win7, 64bit, Python2.7) and tried the same to exactly the same script: But "python setup.py py2exe" returned this message (hope I translated it correctly into english): "The command 'python' is either written wrong or couldn't be found."
现在,我将py2exe 0.6.9(win64)安装到第二台PC(Win7、64位,Python2.7),并尝试将其完全相同地编写为同一脚本:但是“ python setup.py py2exe”返回了此消息(希望我正确翻译了此消息)译成英文):“命令'python'写错或找不到。” Why does this happen?
为什么会这样? How can I solve this?
我该如何解决?
This has nothing to do with py2exe
, and everything to do with the machine's setup. 这与
py2exe
无关,与机器的设置无关。
You don't have python
on your path. 您的路径上没有
python
。 You can test this by just running python
by itself to open the interactive interpreter. 您可以通过仅运行
python
来打开交互式解释器来进行测试。 If cmd
can't find python
, it can't run it. 如果
cmd
找不到python
,它将无法运行。
Here are some ways around this: 以下是一些解决方法:
C:\\Python27\\bin\\Python.exe
, type that instead of just python
. C:\\Python27\\bin\\Python.exe
,请键入它而不是python
。 cmd
window. cmd
窗口中临时编辑PATH环境变量。 With the above example, this would be set PATH=%PATH%;C:\\Python27\\bin
. set PATH=%PATH%;C:\\Python27\\bin
。 You will have to do this again every time you reboot, open a new cmd
window, etc. cmd
窗口等时,都必须再次执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.