def autodetect():
    """
    Auto-detects and use the first available QT_API by importing them in the
    following order:

    1) PyQt5
    2) PyQt4
    3) PySide
    """
    logging.getLogger(__name__).debug('auto-detecting QT_API')
    try:
        logging.getLogger(__name__).debug('trying PyQt5')
        import PyQt5
        os.environ[QT_API] = PYQT5_API
        from PyQt5 import QtCore
        QtCore.QCoreApplication.setLibraryPaths([os.sep.join([sys.prefix,
                                                              'Lib', 'site-packages', 'PyQt5', 'plugins'])])
        logging.getLogger(__name__).debug('imported PyQt5')
    except ImportError:
        try:
            logging.getLogger(__name__).debug('trying PyQt4')
            setup_apiv2()
            import PyQt4
            os.environ[QT_API] = PYQT4_API
            logging.getLogger(__name__).debug('imported PyQt4')
        except ImportError:
            try:
                logging.getLogger(__name__).debug('trying PySide')
                import PySide
                os.environ[QT_API] = PYSIDE_API
                logging.getLogger(__name__).debug('imported PySide')
            except __HOLE__:
                raise PythonQtError('No Qt bindings could be found')
dataset/ETHPy150Open dragondjf/PFramer/qframer/qt/__init__.py/autodetect