【问题标题】:Make a python project with tkinter executable使用 tkinter 可执行文件制作 python 项目
【发布时间】:2020-01-12 17:38:35
【问题描述】:

渲染一个由多个 python 脚本组成的项目(项目),并且在文件夹下也包含 python 脚本或不可执行(python 2.7)

我使用以下代码使我的项目可执行:pyinstaller intercomplete.py(intercomplete.py 是我使用 anaconda spyder 运行以启动 GUI 的脚本),但它提供了以下回溯:

hiddenimports = pytest.freeze_includes ()
AttributeError: 'module' object has no attribute 'freeze_includes' for the code is too large

Salam 大家这里是我的问题,我在 python 和 tkinter 下创建了一个程序项目,这个程序由一个文件夹中包含的几个 Python 脚本组成,在这些 python 脚本旁边有包含其他 python 脚本的子文件夹,子文件夹允许将程序处理的数据记录为文本文件、png 图像、pdf 图像和 Excel 表格,有一个名为 intercomplete.py 的主脚本。

它正在运行并显示一个图形界面,允许单击菜单命令和按钮来调用我在顶部引用的其他 python 脚本,我想让这个程序可执行但我不知道如何继续使用 pyinstaller我安装的(pyinstaller3.5)。

你能帮我制作这个可执行文件吗,因为我的博士学位需要它,谢谢,如果我的英语不好,很抱歉,因为我只是在网上使用翻译器。

【问题讨论】:

    标签: python tkinter pyinstaller


    【解决方案1】:

    使用此function 将您的脚本编译为可执行文件

    pyinstaller --windowed --onefile   intercomplete.py
    

    它将创建一个包含名为intercomplete.exe的exe文件的dist文件夹运行它。

    【讨论】:

    • 完成后给我反馈。
    • 非常感谢您在这里的回答我按照您的要求做了,但我仍然得到这个回溯:hiddenimports = pytest.freeze_includes() AttributeError: 'module' object has no attribute 'freeze_includes' 我做不明白是什么问题,尤其是顶部的最后两行 Traceback 如果有人有答案或解决方案,我将不胜感激,谢谢
    【解决方案2】:

    非常感谢您在这里的回答我按照您的要求做了,但我仍然得到这个回溯:hiddenimports = pytest.freeze_includes() AttributeError: 'module' object has no attribute 'freeze_includes' 我不明白什么是问题,尤其是顶部的最后两行 Traceback 如果有人有答案或解决方案,我将不胜感激,谢谢-

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-27
      • 1970-01-01
      • 2023-03-27
      • 2021-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多