def importpyqt():
    ''' Try to import pyqt, either PyQt4 or PyQt5, but allow it to fail '''
    try:    
        from PyQt4 import QtGui as pyqt
    except:
        try:    from PyQt5 import QtWidgets as pyqt
        except: pyqt = Exception('QtGui could not be imported')
    return  pyqt