1

I have a PyQt application that I am trying to compile into one exe using PyInstaller 3.1. It does compile into an exe, however, the GUI doesn't show up upon launch (clicking the exe). One of the compilation message is:

ImportError: No module named site
5576 ERROR: Cannot find PyQt4 plugin directories
5576 WARNING: Hidden import 'PyQT4._qt' not found (probably old hook)

I think this is why the UI wouldn't show up. I've already add all of the paths that has PyQt4 in the pathex attribute for the Analysis object to no avail. Below is my spec file:

# -*- 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 )

Any ideas what's next to try?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.