Qwidget.show() take 5 seconds to load in pyqt5
-
It take 5 seconds to load even in the simplest apps like this:
import sys from PyQt5.QtWidgets import QApplication, QWidget app = QApplication(sys.argv) window = QWidget() window.show() sys.exit(app.exec_())
Specifically on show() method. It started a week ago, and I don't know why; before that, the loading was instant
Using cProfile i get this:
ncalls tottime percall cumtime percall filename:lineno(function) 1 5.063 5.063 5.063 5.063 {built-in method show}
I'm on Windows 11. python version is 3.10.11, pyqt5 version is 5.15.10. I reinstalled pyqt5, ran it in the venv, still doesn't work. same story with pyqt6. it is always ~5 seconds.
-
Hi and welcome to devnet,
Do you have the same issue with PySide6 ?
Did you update Windows ? Your graphics driver ? Installed a new application ? -
Hi and welcome to devnet,
Do you have the same issue with PySide6 ?
Did you update Windows ? Your graphics driver ? Installed a new application ?@SGaist hi
i tried it with pyside6, same result:1 5.079 5.079 5.079 5.079 {method 'show' of 'PySide6.QtWidgets.QWidget' objects}
I didn't update windows and graphics driver, nothing at all. before that i installed pyqt5-tools to try qt designer and change my ssd recently, nothing more
-
Did you try to re-install Python ?
-
@SGaist i tried it with python 3.12.1 in venv, no results. i'm also found something strange: doesn't matter how many show methods i use, this will be always 5 second delay:
2 qwidget.show():ncalls tottime percall cumtime percall filename:lineno(function) 2 5.063 2.532 5.063 2.532 {built-in method show}
3 of them:
ncalls tottime percall cumtime percall filename:lineno(function) 3 5.096 1.699 5.096 1.699 {built-in method show}
also sry for long answers, there is 600 seconds cooldown
-
@SGaist i tried it with python 3.12.1 in venv, no results. i'm also found something strange: doesn't matter how many show methods i use, this will be always 5 second delay:
2 qwidget.show():ncalls tottime percall cumtime percall filename:lineno(function) 2 5.063 2.532 5.063 2.532 {built-in method show}
3 of them:
ncalls tottime percall cumtime percall filename:lineno(function) 3 5.096 1.699 5.096 1.699 {built-in method show}
also sry for long answers, there is 600 seconds cooldown
@glikoliz The show method schedules for the widget to be shown which should happen as soon as the event loop starts so calling it multiple times should have no effects.
Do you have a mean to drill more deeply in the call stack ? Show will in the trigger platform specific code.
-
@glikoliz The show method schedules for the widget to be shown which should happen as soon as the event loop starts so calling it multiple times should have no effects.
Do you have a mean to drill more deeply in the call stack ? Show will in the trigger platform specific code.
-
@SGaist how can i see call stack? i tried traceback, cprofile and line_profiler, they all just tell me about built-in method show
-
@SGaist i can't see what's happening in show() method. i don't know what else could i see with any profiler. also just checked, qt on c++ works the same
-