尝试使用py2exe,但无法识别python [英] Trying to use py2exe, but python is not recognized
问题描述
我正在学习 http://www.py2exe.org/index 上的教程.cgi/Tutorial 了解如何使用 py2exe.我进入第 3 步,您应该在其中运行命令:
I am following the the tutorial at http://www.py2exe.org/index.cgi/Tutorial to figure out how to use py2exe. I get down to step 3 where you are supposed to run the command:
python setup.py py2exe
我这样做了,然后我收到了这个错误:
I do that and then I get this error:
'python' is not recognized as an internal or external command,
operable program or batch file.
我的机器上安装了 python 2.4.有任何想法吗?我相信这很简单.
I have python 2.4 installed on my machine. any idea's? I am sure it is something simple.
推荐答案
Python 不在您的道路上.如果你确实有 Python 2.4,它应该是 C:\Python24\python.exe
和默认安装程序.
Python just isn't on your path. If you indeed have Python 2.4, it should be C:\Python24\python.exe
with the default installer.
无论文件位于何处,如果您没有在路径中设置 Python 的文件夹,您将把命令写成
Wherever the file is located, if you don't set Python's folder in your path, you will write the command as
C:\Python24\python.exe setup.py py2exe
(或任何正确的路径).
(or whatever the correct path is).
根据您的安装配置方式,您可以只执行
Depending on how your installation was configured, you might be able to just do
setup.py py2exe
因为 Windows 可能自动将 *.py 文件与 Python 关联起来.
since Windows might automatically associate *.py files with Python.
您可能还想阅读 "查找 Python 可执行文件" 来自 Python 文档.
You might want to also read "Finding the Python Executable" from the Python documentation.
这篇关于尝试使用py2exe,但无法识别python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!