Quote:
Originally Posted by DiapDealer
2) My hope for my plugins was to drop support for PtQt4 completely and use my own try/except imports for PyQt5/6 in order to support calibre 2.0+. This seems fairly trivial in my testing and, in fact, seems to work just fine... on systems where calibre is using its own embedded Python/Qt/PyQt. However, this fails miserably on my Arch machine using the pacman-supplied calibre 5.33 because my system has both PyQt5 and PyQt6 installed at the same time. So the initial import of PyQt6 in my plugin does not fail like I need it to with Calibre 5.33 on that system. Any way around this? I don't want to have to tell my users that they need to uninstall PyQt6 on Arch to get things working.
|
Maybe you could check for calibre version instead of Qt:
Code:
from calibre.constants import numeric_version
if numeric_version < (6, 0, 0):
PyQt5 imports
else:
PyQt6 imports
EDIT: @Leseratte_10 beated me. =)