Pyinstaller和wx

时间:2015-09-13 22:05:53

标签: python-2.7 wxpython pyinstaller

我是pyinstaller的新手。我正在尝试从一些python脚本构建一个应用程序。 我有两个脚本:interface.py和loadsave.py。 在教程之后,我发现我已经将它发送到.spec文件(没什么,我知道)然后一切都停止了。 这是我的interface.spec:

# -*- mode: python -*-
a = Analysis(['interface.py','loadsave.py'],
             pathex=['/home/alessandro/Scrivania/tesi/ProgettoTesi_1'],
             hiddenimports=[],
             hookspath=None,
             runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='interface',
          debug=False,
          strip=None,
          upx=False,
          console=False )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=None,
               upx=False,
               name='interface')

以及我在dist / interface /目录中尝试运行./interface时的错误

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/alessandro/Scrivania/tesi/ProgettoTesi_1/build/interface/out00-PYZ.pyz/wx", line 45, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/home/alessandro/Scrivania/tesi/ProgettoTesi_1/build/interface/out00-PYZ.pyz/wx._core", line 4, in <module>
ImportError: No module named _core_

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

尝试添加.spec文件'wx._core'中的hiddenimports或只添加_core。