【问题标题】:Does executable file created using pyinstaller require Python and other modules installed on PC?使用 pyinstaller 创建的可执行文件是否需要在 PC 上安装 Python 和其他模块?
【发布时间】:2020-11-06 00:14:33
【问题描述】:

我使用 pyinstaller 创建了一个可执行文件 (.exe)。 如果一定要分享,其他电脑是否需要安装 Python 和其他模块?

【问题讨论】:

  • 如果你在生成的可执行文件中包含了所有需要的模块,那么没有。
  • 取决于您在运行 pyinstaller 时传递的标志,如果您运行 -F 标志,则无需发送比 .exe 文件更多的文件。

标签: python python-3.x tkinter pyinstaller


【解决方案1】:

Pyinstaller 只是将所有库和代码压缩到一个可执行文件中,所以没有。但是如果你想让其他人运行你的 Python 文件,他们确实需要你在代码中使用的库。您可以使用Pyinstaller 的一些参数使其成为一个可执行文件。

pyinstaller -F <my_file> # -F == one file

有关Pyinstaller 及其功能的更多信息,您可以阅读手册here 或使用Pyinstaller 的帮助参数

pyinstaller -h

【讨论】:

    猜你喜欢
    • 2023-03-27
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-27
    • 2020-01-01
    相关资源
    最近更新 更多