使用 pyinstaller 创建的可执行文件是否需要在 PC 上安装 Python 和其他模块?

Does executable file created using pyinstaller require Python and other modules installed on PC?

我使用 pyinstaller 创建了一个可执行文件 (.exe)。 如果我必须共享它,另一台计算机是否需要安装 Python 和其他模块?

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

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

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

的帮助参数
pyinstaller -h