Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kepub Output - QT errors in Calibre 6.x #147

Closed
7 of 11 tasks
skoobasteeve opened this issue Jul 18, 2022 · 4 comments
Closed
7 of 11 tasks

Kepub Output - QT errors in Calibre 6.x #147

skoobasteeve opened this issue Jul 18, 2022 · 4 comments

Comments

@skoobasteeve
Copy link

skoobasteeve commented Jul 18, 2022

Bug Checklist

These items are mandatory. If you need help finding this information submit the
bug report with as much completed as you can and ask for help finding the rest.

  • I am using the latest version of calibre to report this bug, which is: 6.1
  • I am using an official calibre release, not one from a third party (e.g.
    your Linux distro, Flatpak, Chocolatey package, Homebrew, etc.)
  • I am using the latest version of this plugin, which is: 3.6.0
  • My operating system is (e.g. Windows 10, Windows 8.1, Windows 8, macOS
    10.15.5, Fedora 32, Arch Linux, etc.): Fedora 36
  • I have included the full, complete, unmodified debug log from calibre
    • Directions for getting the debug log are under the "Logs" header below.
  • I have translated the text in any screenshots and logs to English, or all
    screenshots and logs included are in English.

These items are optional. Fill in as much of them as possible. If something is
not applicable to your bug report, note that.

  • I have installed the Scramble Epub plugin (see
    https://www.mobileread.com/forums/showthread.php?t=267998) and will attach
    a scrambled copy of the book I'm having problems with (attach a file by
    dragging and dropping onto the Github editor).
    • If this is a conversion bug, I will also attach a scrambled copy of
      the converted book.
  • The path to my calibre library or to a book in my calibre library has
    non-ASCII characters: no
  • If I am using Windows 10, I (have/have not) enabled Windows' beta support
    for Unicode (see
    https://www.mobileread.com/forums/showpost.php?p=3988195&postcount=2052)
  • If I am using Windows 10, does this bug happens with beta Unicode support
    both enabled and disabled, only when enabled, or only when disabled?

Describe the bug

After upgrading to Calibre 6.0 and installing the 3.6.0 versions of the Kobo plugins in this repo, I get a QT error when trying to convert an EPUB to KEPUB. The behavior persists after upgrading to 6.1.

calibre, version 6.1.0
ERROR: Unhandled exception: <b>ModuleNotFoundError</b>:No module named 'PyQt4'

calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
Traceback (most recent call last):
  File "calibre_plugins.kepubout.conversion.output_config", line 66, in setupUi
    from PyQt5 import Qt as QtGui
ImportError: cannot import name 'Qt' from 'qt' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/__init__.pyc)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/gui2/convert/single.py", line 225, in setup_pipeline
  File "calibre_plugins.kepubout.conversion.kepub_output", line 141, in gui_configuration_widget
    return PluginWidget(parent, get_option_by_name, get_option_help, db, book_id)
  File "calibre_plugins.kepubout.conversion.output_config", line 40, in __init__
    Widget.__init__(
  File "calibre/gui2/convert/__init__.py", line 65, in __init__
  File "calibre_plugins.kepubout.conversion.output_config", line 69, in setupUi
    from PyQt4 import QtCore
ModuleNotFoundError: No module named 'PyQt4'

Steps to Reproduce

Steps to reproduce the behavior (as detailed as you can):

  1. Install Calibre 6.x
  2. Install Kobo plugins version 3.6.0
  3. Add EPUB to library
  4. Select the book and click Convert Individually
  5. In the Output format dropdown, select KEPUB

Expected behavior

No error message, book converts after selecting OK.

Actual behaviour

Error message pops up. If you close the message and click OK to convert the book, another error message shows up:

calibre, version 6.1.0
ERROR: Unhandled exception: <b>AttributeError</b>:'MetadataWidget' object has no attribute 'opf_file'

calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
Traceback (most recent call last):
  File "calibre/gui2/convert/single.py", line 292, in accept
AttributeError: 'MetadataWidget' object has no attribute 'opf_file'

Logs

calibre Debug log
calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
QPA platform: wayland
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 209.75483870967741 x 215.1529411764706
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[0.04] splash screen shown
[0.04] Initializing db...
[0.05] db initialized
[0.05] Constructing main UI...
[0.51] main UI initialized...
[0.51] Hiding splash screen
Starting QuickView
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x55ecc0816940) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x55ecbfa4c3e0) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x55ecc0816940) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x55ecbfa4c3e0) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
Traceback (most recent call last):
  File "calibre_plugins.kepubout.conversion.output_config", line 66, in setupUi
    from PyQt5 import Qt as QtGui
ImportError: cannot import name 'Qt' from 'qt' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/__init__.pyc)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/gui2/convert/single.py", line 225, in setup_pipeline
  File "calibre_plugins.kepubout.conversion.kepub_output", line 141, in gui_configuration_widget
    return PluginWidget(parent, get_option_by_name, get_option_help, db, book_id)
  File "calibre_plugins.kepubout.conversion.output_config", line 40, in __init__
    Widget.__init__(
  File "calibre/gui2/convert/__init__.py", line 65, in __init__
  File "calibre_plugins.kepubout.conversion.output_config", line 69, in setupUi
    from PyQt4 import QtCore
ModuleNotFoundError: No module named 'PyQt4'

calibre 6.1  embedded-python: True
Linux-5.18.10-200.fc36.x86_64-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.18.10-200.fc36.x86_64', '#1 SMP PREEMPT_DYNAMIC Thu Jul 7 17:21:38 UTC 2022')
Python 3.10.1
Interface language: None
Successfully initialized third party plugins: KePub Input (3, 6, 0) && KePub Metadata Reader (3, 6, 0) && KePub Metadata Writer (3, 6, 0) && KePub Output (3, 6, 0) && KoboTouchExtended (3, 6, 0)
Traceback (most recent call last):
  File "calibre/gui2/convert/single.py", line 292, in accept
AttributeError: 'MetadataWidget' object has no attribute 'opf_file'

[9.04] splash screen hidden
[9.04] Started up in 9.04 seconds with 76 books

Additional context

I've tried installing PyQt4-devel and PyQT5-devel from the repos but it doesn't help. I'm assuming this has something to do with Calibre's move to QT6 in the latest releases.

Let me know if any additional information would help.

Thank you for all your work!

@Ahasvero
Copy link

Hi, same problem. Please resolve. Thank you

@jgoguen
Copy link
Owner

jgoguen commented Jul 31, 2022

This should be fixed by #148 by @davidfor. Once the plugins are built I'll upload them to MobileRead and calibre will pick them up a little while after that.

@jgoguen jgoguen closed this as completed Jul 31, 2022
@skoobasteeve
Copy link
Author

Confirmed it's fixed for me on both Fedora 36 and Ubuntu 20.04 with the latest Calibre. Thanks for your work!!

@Ahasvero
Copy link

Ahasvero commented Aug 2, 2022

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants