
The second step is to identify which specific imported module is the source of the problem. The first step established that importlib is not itself the cause of the problem. On my system (ArchLinux, Python-3.5.2, Qt-5.7.1, PyQt-5.7), the second one produces the following output: Sys Path: Run the script like this: $ python /tmp/test.py 1 (Even if option 2 doesn't hang, the sys.path details are likely to be relevant). Please run this script exactly as described below, and add the output to your question. It is vital to proceed one step at a time, and be careful to avoid introducing any potentially confounding variables. It tests just one thing: does calling importlib.import_module after creating a QApplication make the interpreter hang on your system? Note that, for now, it only tries to import a module from the python standard library. This is not (yet) a real answer, but it might provide the first step in how to find one.īelow is the minimal test case I suggested in my first comment on the question.
How can I fix this behaviour? This is important to me cos I'd like to load plugins dynamically once my pyqt applications has started.
What's the reason of from PyQt5 import Qt (or others pyqt modules) getting stuck on my box and other people not being able to reproduce?. Some very nice people from #pyqt freenode channel helped me to test the repo and none of them were able to reproduce the issue, the python versions and platforms they used were: Pyqt was installed on the virtualenvs using pip and the versions are these ones: > QtCore.QT_VERSION Tested with a couple of virtualenvs on win7: Output of python main.py 2: (p圓52) D:\sources\personal\python\pyqt\mcve>python main.py 2ĭ:\virtual_envs\p圓52\Scripts\python35.zip If I run python main.py 2 the process hangs (probably in a infinite loop) without giving any error. If I run python main.py 1 everything works as expected. QtWidgets.QApplication(sys.argv), let's say I got this little snippet main.py: import sys I'm having troubles importing modules after the line