Using the latest pyinstaller on Windows 7 to make a standalone exe (-F), when running the exe:
ImportError: cannot import name QtGui
Workaround. This worked:
# Various imports, whatever, using normal sys.path, for example:
import os, sys, re, time, random
import subprocess, psutil
# Save sys.path
sys_path_saved = sys.path
# Limit sys.path for PySide import
sys.path = ['c:\\python27\\lib\\site-packages']
# PySide imports with limited sys.path
from PySide import QtGui, QtCore
from PySide.QtGui import QApplication, QLineEdit
from PySide.QtCore import QSettings, Qt
# Reset sys.path to original
sys.path = sys_path_saved
# Remainder of code...
Pyinstaller 1.5.1 should do a fine job of locating dependencies, and often does. However, all of many many attempts to use its pathex or hiddenimports in .spec failed. Modifying my environment variables also failed. Extracting various module files manually from from .egg sometimes worked.
However for PySide imports, the sys.path temporary limitation above was the workaround that worked.
Update: Unfortunately the exe only works on a machine with Python/Pyside installed, doesn't work on XP without Python.