尝试使用py2exe,但无法识别python

发布于 2024-09-04 08:16:28 字数 409 浏览 8 评论 0原文

我正在关注 http://www.py2exe.org/index.cgi/Tutorial 上的教程 了解如何使用 py2exe。我进入第 3 步,您应该运行命令:

python setup.py py2exe

我这样做了,然后收到此错误:

'python' is not recognized as an internal or external command,
operable program or batch file.

我的计算机上安装了 python 2.4。有什么想法吗?我确信这很简单。

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.

I have python 2.4 installed on my machine. any idea's? I am sure it is something simple.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好听的两个字的网名 2024-09-11 08:16:28

Python 只是不在你的道路上。如果您确实有 Python 2.4,则默认安装程序应为 C:\Python24\python.exe

无论文件位于何处,如果您没有在路径中设置 Python 的文件夹,您将把命令编写为

C:\Python24\python.exe setup.py py2exe

(或任何正确的路径)。

根据您的安装配置方式,您也许可以这样做,

setup.py py2exe

因为 Windows 可能会自动将 *.py 文件与 Python 关联起来。

您可能还想阅读“查找 Python 可执行文件” 来自 Python 文档。

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.

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

since Windows might automatically associate *.py files with Python.

You might want to also read "Finding the Python Executable" from the Python documentation.

软甜啾 2024-09-11 08:16:28

您需要将 python 添加到系统路径。在不同的操作系统上,此操作的执行方式有所不同。 适用于大多数 Windows 版本的说明
您需要添加 C:\Python24 或计算机上 python 所在的任何位置。

You need to add python to your system path. This is done differently on different OSs. Instructions for most versions of Windows
You need to add C:\Python24 or whereever python is on your computer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文