10-31-2019, 07:03 AM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
|
Plugins Failing to Import
So, I'm working on developing a plugin, and for some reason it won't import ANY zip files that I create. It's telling me that there is no top-level __init__.py file when there most definitely is. It imports fine if I download the interface_demo_plugin.zip file from Calibre webpage, which I used to test the manual import, but if I decompress it, and then recompress the exact same thing, it refuses to import.
I thought perhaps it was my compression settings, but I'm using the default "compress files" action. I've also tried 2 other compression applications, and even tried an entirely different operating system, and yet nothing will import. Any ideas? Code:
calibre, version 4.2.0 ERROR: Unhandled exception: <b>InvalidPlugin</b>:The plugin in u'/Users/kylecarroll/Desktop/interface_demo_plugin.zip' is invalid. It does not contain a top-level __init__.py file calibre 4.2 embedded-python: True is64bit: True Darwin-19.0.0-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '19.0.0', 'Darwin Kernel Version 19.0.0: Wed Sep 25 20:18:50 PDT 2019; root:xnu-6153.11.26~2/RELEASE_X86_64') Python 2.7.16 OSX: ('10.15', ('', '', ''), 'x86_64') Interface language: None Successfully initialized third party plugins: DeDRM (6, 5, 3) && Goodreads (1, 4, 0) && Goodreads Sync (1, 12, 1) Traceback (most recent call last): File "site-packages/calibre/gui2/preferences/plugins.py", line 319, in add_plugin File "site-packages/calibre/customize/ui.py", line 472, in add_plugin File "site-packages/calibre/customize/ui.py", line 61, in load_plugin File "site-packages/calibre/customize/zipplugin.py", line 194, in load File "site-packages/calibre/customize/zipplugin.py", line 292, in _locate_code InvalidPlugin: The plugin in u'/Users/kylecarroll/Desktop/interface_demo_plugin.zip' is invalid. It does not contain a top-level __init__.py file |
10-31-2019, 08:20 AM | #2 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Dont use an external compressor, there is a nice tool calibre-customize you can use to build plugins: https://manual.calibre-ebook.com/cre...ugging-plugins
|
10-31-2019, 09:51 AM | #3 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
For the record, most of the times I have seen that error, it is because the zip file produced put all my files in a sub-directory within the zip file. The other times it was because I forgot the __init__.py file.
|
10-31-2019, 06:46 PM | #4 |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
|
Thanks, Kovid! Using the customize tool worked.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Import Author And Title From Filename & Import Other Tags And Cover From File | DazJWood | Library Management | 25 | 10-06-2021 10:18 AM |
Import on Filename changes mid import due to book error | Vortex | Calibre | 3 | 12-05-2014 11:49 AM |
Failing to import cover from most CBR | snipe2004 | Library Management | 7 | 03-14-2014 04:35 AM |
Import failed Error:404 when attempting to import from Calibre to Stanza | dvond | Apple Devices | 0 | 05-13-2011 03:00 PM |
new plugins and using import | KevinH | Plugins | 4 | 05-09-2011 11:48 PM |