pyside6 with Addons > 6.5.3 hags on windows 10
-
we are having a problem with pySide6 hanging when
QUiLoader
is created afterQApplication
in any pip installed versions newer than 6.5.3.we use the official python for windows (3.10, 3.11, we tested a few) for instance this one:
https://www.python.org/ftp/python/3.11.6/python-3.11.6-amd64.exe
when PySide6 is pip installed:
python -m "pip" install PySide6 --prefix=%INSTALL_PATH%
then it hangs on QLoader:
import PySide6 from PySide6.QtUiTools import QUiLoader from PySide6.QtWidgets import QApplication app = QApplication() loader = QUiLoader()
this never completes and hangs the interpreter. After a fair bit of experimentation we discovered that
Pyside6-Addons
is what is causing the issue and when we install only the essentials the problem goes away:python -m "pip" install "PySide6-Essentials" --prefix=%INSTALL_PATH%
We tested many versions and the last one that works without special treatment is 6.5.3. everything newer has to be installed without the Addons.
widows 10 1909
at this stage we do not know what could be causing this. There are posts online where people complain about the same issue so this is not isolated case. We tested in very clean environments with only PySide6 pip installed to the clean python so this is not a conflict with another package.
-
Most likely it is an old bug in the QWebEngineView Designer plugin that causes a QUiLoader to hang on loading. Please consider updating to 6.8 or use uic ( see https://doc.qt.io/qtforpython-6/tutorials/basictutorial/uifiles.html#tutorial-uifiles ).
-
This is PySide 6.8.0.1 so the problem is still there. The page you linked describes the same process we use (option B).
We actually useQt.py
, which handles loading UIs throughQtCompat.loadUi
, which uses the QUiLoader under the hood. -
Please consider migrating to Option A) (uic) , which reduces the overhead of loading and avoids these problems altogether.
If it hangs, it means some manifestation of QTBUG-118317 reappeared. You can try to verify by removing the plugin and then comment on the report.
-
It looks exactly like the bug reported there and it says it was fixed.
I think we are ok to use Pyside6 without the addons for now. Everything works and I do not think we are missing any functionality. I reported it here as it looks like a bug and I thought it should have been reported and addressed in the future releases of PySide.
Using option A is not an option for us. we have an old pipeline with hundreds of .ui files dynamically loaded all over the place. It is also a very convenient way to build interfaces and I'm not sure why anyone would want to add an extra step and generate the python classes manually.