如何将 .py 转换为 .exe ? Pyinstaller 不工作

How can I convert .py into an .exe ? Pyinstaller does not work

pip install pyinstaller


pyinstaller app.py

]1

所以它告诉我找不到 pyinstaller。但是我已经下载了pyinstaller。 不知道为什么?

您需要将pyinstaller添加到PATH环境变量。

  • 安装时,选中添加 python 到路径。
  • 首先找到pyinstaller.exe的路径,一般在python安装的Scripts目录下。然后从 Cmd.
  • 复制文件路径和 运行 setx %PATH% "%PATH%;FULL PATH"