I’ve heard that the output actually does not work for my template and so I don’t know if it works.
Add a system dependency (usually via System Dependencies tool) python310Packages.pyqt5 . When you import it from your code, it will probably auto-guess and auto-install the python version of the package, which you can probably ignore since a system dependency will be used for it.
(NOTE: Adding this system package may cause all installed python packages to not be found. There is a fix for this if this happens.)