def _init():
    """Try loading each binding in turn

    Please note: the entire Qt module is replaced with this code:
        sys.modules["Qt"] = binding()

    This means no functions or variables can be called after
    this has executed.

    """

    preferred = os.getenv("QT_PREFERRED_BINDING")
    verbose = os.getenv("QT_VERBOSE") is not None

    if preferred:

        # Debug mode, used in installer
        if preferred == "None":
            sys.modules[__name__].__wrapper_version__ = __version__
            return

        available = {
            "PySide2": _pyside2,
            "PySide": _pyside,
            "PyQt5": _pyqt5,
            "PyQt4": _pyqt4
        }

        if preferred not in available:
            raise ImportError("Preferred Qt binding \"%s\" "
                              "not available" % preferred)

        binding = available[preferred]
        sys.modules[__name__] = binding()
        return

    else:
        for binding in (_pyside2,
                        _pyqt5,
                        _pyside,
                        _pyqt4):

            if verbose:
                sys.stdout.write("Trying %s" % binding.__name__[1:])

            try:
                sys.modules[__name__] = binding()
                return

            except ImportError as e:

                if verbose:
                    sys.stdout.write(" - ImportError(\"%s\")\n" % e)

                continue

    # If not binding were found, throw this error
    raise ImportError("No Qt binding were found.")