如何在没有 python 的情况下将我的 Python 脚本分发到其他计算机?

How to distribute my Python script to other computers without python?

我有这个 Python 脚本,我想 运行 在没有 python.So 的其他 windows 计算机上 我已经尝试过 py2exe 和 pyinstaller 但 none这些工作就像我尝试将 .exe 文件复制到另一个系统并 运行 它但我得到一个错误:

Traceback (most recent call last):
  File "client.pyw", line 4, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "gtk\__init__.pyo", line 30, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "gobject\__init__.pyo", line 26, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "glib\__init__.pyo", line 22, in <module>
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading glib\_glib.pyd

您可以尝试 cx_Freeze 或包括 Python 安装程序安装程序(可能是批处理脚本):

msiexec /i /quiet /passive python.msi

当需要从 Python 脚本制作可执行文件时,我发现 py2exe (or its GUI brother GUI2Exe to be the most useful tools. There are a few other options