--- a/install.py Mon Nov 06 20:00:42 2017 +0100 +++ b/install.py Tue Nov 07 19:37:17 2017 +0100 @@ -109,6 +109,8 @@ """ global currDir + print() + if sys.platform.startswith("win"): # different meaning of input between Py2 and Py3 try: @@ -1192,13 +1194,18 @@ if pyqtVariant == "PyQt4": impModulesList = [ "PyQt4.QtGui", "PyQt4.QtNetwork", "PyQt4.QtSql", - "PyQt4.QtSvg", + "PyQt4.QtSvg", "PyQt4.QtWebKit", ] + altModulesList = [] else: impModulesList = [ "PyQt5.QtGui", "PyQt5.QtNetwork", "PyQt5.QtPrintSupport", "PyQt5.QtSql", "PyQt5.QtSvg", "PyQt5.QtWidgets", ] + altModulesList = [ + ("PyQt5.QtWebEngineWidgets", "PyQt5.QtWebKitWidgets") + ] + # check mandatory modules modulesOK = True for impModule in impModulesList: name = impModule.split(".")[1] @@ -1211,6 +1218,26 @@ modulesOK = False if not modulesOK: exit(1) + # check mandatory modules with alternatives + if altModulesList: + altModulesOK = True + for altModules in altModulesList: + modulesOK = False + for altModule in altModules: + name = altModule.split(".")[1] + try: + __import__(altModule) + print("Found", name) + modulesOK = True + break + except ImportError: + pass + if not modulesOK: + altModulesOK = False + print('Sorry, please install {0}.' + .format(" or ".join(altModulesList))) + if not altModulesOK: + exit(1) # determine the platform dependent black list if sys.platform.startswith("win"):