我有一個PyQt應用程序,我試圖用PyInstaller 3.1編譯成一個exe文件。它編譯成exe文件,但是,啓動時不顯示GUI(單擊exe文件)。其中一條編輯信息是:PyInstaller無法找到pyqt4插件目錄
ImportError: No module named site 5576 ERROR: Cannot find PyQt4 plugin directories 5576 WARNING: Hidden import 'PyQT4._qt' not found (probably old hook)
我覺得這就是爲什麼UI不會顯示出來。我已經在分析對象的pathex屬性中添加了PyQt4的所有路徑,但都無濟於事。下面是我的spec文件:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['main32.py'],
pathex=['C:/OSGeo4W/apps/Python27/Lib/site-packages/PyQt4','./src'],
binaries=None,
datas=None,
hiddenimports=[],
hookspath=None,
runtime_hooks=None,
excludes=None,
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='MyExe',
debug=False,
strip=None,
upx=True,
console=False)
任何想法是下一個試試?
是'site'包通過你的書面或它的庫的依賴? – Astery