Python 个未在目标 PC 上安装 python 个可执行文件

Python executables without python installed on target PC

我听说,Python 程序可以“转换”为可执行文件。我的问题是:

  1. 该可执行文件是否可以在 PC 上运行,但未安装 python?
  2. 该可执行文件可以在 PC 上运行吗?我使用 pip 为“开发”手动安装的所有库都没有安装在 PC 上?
  3. 如果对前面问题的回答是肯定的,那么 - 运行 我的可执行文件会首先安装 python 并使用库吗?

谢谢!

该可执行文件可以在未安装的 PC 上运行吗python?

Yes

该可执行文件可以在 PC 上运行吗?我用 pip 手动安装的所有库都没有安装,用于“开发”?

Yes

如果对前面问题的回答是肯定的,那么 - 运行我的可执行文件会首先安装 python 和使用的库吗?

No need to install python just run newly created .exe on windows machine by copy paste on it.

是的,您可以使用 pyinstaller 来完成。 在你的机器上做 运行

pip install pyinstaller
pyinstaller --onefile -w 'filename.py'

这将在上方创建“dist”文件夹。在这里你会得到你的“.exe”文件。

Ref:
https://www.geeksforgeeks.org/convert-python-script-to-exe-file/