title: Pyinstaller: ImportError: cannot import name QtGui
body: <p>Using the latest <a href="http://www.pyinstaller.org/" rel="nofollow">pyinstaller</a> on Windows 7 to make a standalone exe (-F), when running the exe:</p>
  
  <blockquote>
    <p>ImportError: cannot import name QtGui</p>
  </blockquote>
  
  <p>In the pyinstaller hooks directory there is special handling for PyQt4 though not PySide.</p>
  
  <p>Hoping for a workaround for this or something to try.</p>
  
  <p><strong>Environment</strong><br>
  Windows 7 64-bit<br>
  Python 2.7 32-bit<br>
  PYTHONHOME=c:\python27<br>
  PYTHONPATH=c:\python27\lib<br>
  PYTHONLIB=c:\python27\libs\python27.lib;c:\python27\lib\site-packages<br></p>
  
  <p><strong>Steps</strong><br>
  1. Add PySide from <a href="http://releases.qt-project.org/pyside/1.1.1/PySide-1.1.1qt474.win32-py2.7.exe" rel="nofollow">http://releases.qt-project.org/pyside/1.1.1/PySide-1.1.1qt474.win32-py2.7.exe</a><br>
  2. Unzip <a href="https://github.com/pyinstaller/pyinstaller/zipball/develop" rel="nofollow">https://github.com/pyinstaller/pyinstaller/zipball/develop</a> to c:\pyinstaller1.5.1<br>
  3. Run the commands below against a .py file containing simply:<br></p>
  
  <pre><code>from PySide import QtGui
  </code></pre>
  
  <p>[...or QtCore or or.]</p>
  
  <p><strong>Run</strong></p>
  
  <pre><code>c:\pyinstaller1.5.1&gt;pyinstaller.py -F import_test.py
  108 INFO: wrote c:\pyinstaller1.5.1\import_test.spec
  171 INFO: Testing for ability to set icons, version resources...
  296 INFO: ... resource update available
  312 INFO: UPX is not available.
  4321 INFO: checking Analysis
  4382 INFO: checking PYZ
  4430 INFO: checking PKG
  4446 INFO: building because c:\pyinstaller1.5.1\build\pyi.win32\import_test\import_test.exe.manifest changed
  4446 INFO: building PKG out00-PKG.pkg
  16782 INFO: checking EXE
  16782 INFO: rebuilding out00-EXE.toc because pkg is more recent
  16782 INFO: building EXE from out00-EXE.toc
  16799 INFO: Appending archive to EXE c:\pyinstaller1.5.1\dist\import_test.exe
  
  c:\pyinstaller1.5.1&gt;dist\import_test.exe
  Traceback (most recent call last):
    File "&lt;string&gt;", line 23, in &lt;module&gt;
  ImportError: cannot import name QtGui
  </code></pre>
  
  <p><strong>Note</strong><pre>
  At the end of the PySide install (as admin), this message:
      close failed in file object destructor:
      sys.excepthook is missing
      lost sys.stderr
  If that is about post install it can be handled manually:
      c:>python.exe c:\Python27\Scripts\pyside_postinstall.py -install
      Generating file C:\python27\qt.conf...
      PySide installed in c:/python27/Lib/site-packages/PySide...
      The PySide extensions were successfully installed.
  </pre></p>