![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Oct 2019
Device: Kobo Libra H2O
|
Importing QJSEngine from PyQt5.QtQml, not found
So I'm current writing a plugin and need a way to convert javascript code to python and came to a solution by using [QJSEngine] class, however after testing the code in calibre I found out that the module [PyQt5.QtQml] couldn't be found. I got the following error:
"ImportError: No module named QtQml" I looked into calibre installed dir and within it I found that it did include [Qt5Qml.dll] lib however didn't include the python wrapper file. My question are: 1. Is there a reason for not include the python wrapper file for [Qt5Qml.dll] or is [QJSEngine] class is located in a different module within calibre? 2. Is there another way of access javascript code from python using only calibre included libraries? I'm using calibre on windows. Edit: Testing on calibre 4.2 Last edited by mastertea; 10-18-2019 at 12:27 PM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
QJSEngine is not used by calibre. So there is no reason to include the PyQt module, it just wastes space. If you want to run JS from python use QWebEnginePage, see rapyscript.py for an example of doing this. Note that you cannot use QWebEngine in the main calibre process because it needs to be imported before QApplication is constructed, so you will need to fork a worker process to do it.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building from source - PyQt5 with Python 2.7 | faredoon | Development | 8 | 02-06-2018 08:01 PM |
Install Problems With PyQt5 (Win64) | stanking | Plugins | 2 | 10-06-2014 03:28 AM |
No module named PyQt5.Qt | silentfuzzle | Development | 2 | 08-19-2014 12:31 PM |
"Error importing EPUB. EOCD not found. Not a ZIP archive? (Error Code 1068)" | oren | ePub | 8 | 02-20-2012 07:20 AM |
"Error importing EPUB. EOCD not found. Not a ZIP archive? (Error Code 1068)" | oren | Android Devices | 1 | 02-20-2012 04:10 AM |