【问题标题】:How to distribute my Python script to other computers without python?如何在没有 python 的情况下将我的 Python 脚本分发到其他计算机?
【发布时间】:2015-05-30 06:14:11
【问题描述】:

我有这个 Python 脚本,我想在没有 python 的其他 Windows 计算机上运行。所以我尝试了 py2exe 和 pyinstaller,但是当我尝试将 .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

【问题讨论】:

    标签: python windows py2exe pyinstaller


    【解决方案1】:

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

    msiexec /i /quiet /passive python.msi

    【讨论】:

      【解决方案2】:

      当需要使用 Python 脚本制作可执行文件时,我发现 py2exe(或其 GUI 兄弟 GUI2Exe 是最有用的工具。有几个 other options

      【讨论】:

        猜你喜欢
        • 2019-12-14
        • 2020-12-12
        • 2018-12-10
        • 2019-12-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-21
        相关资源
        最近更新 更多