Skip to content

[BUG] cannot convert to PDF #351

@Mat-DB

Description

@Mat-DB

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi,

I have searched a lot and found a solution. I do have not idea it is the best but it works and would like to share it.

Problem

When trying to convert a EPUB (did not test other formats) to PDF a new task is started. This task almost immediately fails with

Calibre failed with error: ImportError: cannot import name 'QWebEnginePage' from 'qt.webengine' (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/webengine.pyc)

Solution

After searching I found the following command,

calibre-debug -c "from PyQt6.QtWebEngineCore import QWebEnginePage; print(QWebEnginePage)"

This gave me the following output, saying it needs libasound.so.2

calibre-debug -c "from PyQt6.QtWebEngineCore import QWebEnginePage; print(QWebEnginePage)"
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 47, in <module>
  File "site.py", line 43, in main
  File "calibre/debug.py", line 242, in main
  File "<string>", line 1, in <module>
  File "bypy-importer.py", line 127, in create_module
ImportError: libasound.so.2: cannot open shared object file: No such file or directory

To solve this I installed libasound2t64 and it was fixed.

apt install libasound2t64 -y

I hope this helps someone or it gets fixed for everyone.
Any feedback is appreciated!

Kind regards,
Matthias

Expected Behavior

The conversion from EPUB to PDF works without errors.

Steps To Reproduce

Try to convert a EPUB to PDF.

Environment

- OS: openmediavault 7.7.13 (Debian 12)
- How docker service was installed: using openmediavault

CPU architecture

x86-64

Docker creation

Docker compose:

---
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    networks:
      - proxy_net
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - DOCKER_MODS=linuxserver/mods:universal-calibre #optional
      #- OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional
    volumes:
      - /sym/appData/calibre-web/config:/config
      - /sym/appData/calibre-web/library:/books
    ports:
      - 8084:8083
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
      
networks:
  proxy_net:
    name: ${PROXY_NET}
    external: true

Container logs

[2025-07-10 22:03:56,058]  INFO {cps.editbooks:186} converting: book id: 2 from: EPUB to: PDF
[2025-07-10 22:03:56,702]  INFO {cps.tasks.convert:162} Book id 2 - target format of .pdf does not exist. Moving forward with convert.
[2025-07-10 22:03:58,720]  INFO {cps.tasks.convert:209} ebook converter failed with error while converting book
[2025-07-10 22:03:58,721] ERROR {cps.tasks.convert:213} Calibre failed with error: ImportError: cannot import name 'QWebEnginePage' from 'qt.webengine' (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/webengine.pyc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions