【问题标题】:kivy windows app is not launchingkivy Windows 应用程序未启动
【发布时间】:2016-08-24 23:55:49
【问题描述】:

我有以下项目结构: Image

我正在尝试通过 Pyinstaller 教程 here 生成 .exe 应用程序 我有以下 .spec 文件:

   # -*- mode: python -*-
    from kivy.deps import glew



    block_cipher = None


    a =       Analysis(['C:\\Users\\Mohamad\\PycharmProjects\\offline_file_archiever\\app\\mai n.py'],
             pathex=['C:\\Users\\Mohamad\\PycharmProjects\\offline_file_archiever\\build'],
             binaries=None,
             datas=None,
             hiddenimports=['sqlite3'],
             runtime_hooks=[],       
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)

    pyz = PYZ(a.pure, a.zipped_data,
                 cipher=block_cipher)
    exe = EXE(pyz,
              a.scripts,
              exclude_binaries=True,
              name='sample_build',
              debug=False,
              strip=False,
              upx=True,
              console=True )



    coll =     COLLECT(exe,Tree('C:/Users/Mohamad/PycharmProjects/offline_file_archiever/app/gui'),
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in glew.dep_bins],
               strip=False,
               upx=True,
               name='sample_build')

但是应用程序只是立即启动和关闭,我找不到问题

【问题讨论】:

  • 从命令行运行应用程序。这将向您显示错误。您很可能缺少一些需要包含在 hiddenimports 中的文件。
  • 我应该在 hiddenimports 中添加什么?
  • @MohamadAlhaddad 看看here

标签: python-2.7 kivy pyinstaller


【解决方案1】:

问题是我没有添加包含在模型包中的“sqlite3”,我认为它无法出现在分析中,并且我已将 .kv 文件添加为数据,因为它被标记为无

datas=None ---> datas = [('/package/file.something','编译后的目标文件夹')]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2015-09-25
    • 2015-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多