【问题标题】:How can I create a Python executable program that doesn't force the user to actually download Python libraries and that stuff in order to be executed?如何创建一个不强制用户实际下载 Python 库和那些东西以便执行的 Python 可执行程序?
【发布时间】:2021-12-29 07:11:35
【问题描述】:

假设我已经构建了一个程序,该程序基本上从用户路径中获取一些图像并使用以下库/模块制作新图像:

os itertools pandas PIL

我现在需要的是让那个程序变成一个可执行文件,可以实际执行无需安装Python环境和代码中使用的库,因为用户不会知道如何编写代码,代码的工作方式可能并不重要。

该程序只能在 Windows 操作系统 (PC) 上运行,并将使用 cmd.exe 作为解释器和用户输入和结果显示的媒介。

【问题讨论】:

    标签: python-3.x windows cmd operating-system software-design


    【解决方案1】:

    已解决here 您可以使用轮子,并运送整个环境。

    @Vincent Caeles: “@rh979 轮子并不意味着拥有所有依赖项。随后您可以执行 pip install path/to/wheel.whl --target /path/to/some/folder 并压缩“文件夹”的内容以将所有依赖项放在 zip 存档中并将其发送到您想要的环境运行您的代码。 "

    另一个选项是 pyinstaller 库,根据文档,它应该可以满足您的需求。

    【讨论】:

    • 你知道pyinstaller是否也这样做?
    • 根据文档的好点似乎是解决方案。但是这个库没有个人经验。
    • 好吧,我想我得到了需要的东西,反正我给你支票✓
    猜你喜欢
    • 1970-01-01
    • 2020-01-17
    • 1970-01-01
    • 1970-01-01
    • 2016-03-27
    • 2013-02-07
    • 1970-01-01
    • 2013-12-24
    • 2022-06-13
    相关资源
    最近更新 更多