View Single Post
Old 01-05-2022, 03:20 PM   #67
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,233
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by DiapDealer View Post
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. =)

Last edited by thiago.eec; 01-05-2022 at 03:23 PM.
thiago.eec is online now   Reply With Quote