I was having the same error - ImportError: No module named PyQt4.QtGui
. Instead of running your python file (which uses PyQt) on the terminal as -
python file_name.py
Run it with sudo privileges -
sudo python file_name.py
This worked for me!