Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-31-2019, 08:03 AM   #1
kylecarroll
Junior Member
kylecarroll began at the beginning.
 
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
kylecarroll is offline   Reply With Quote
Old 10-31-2019, 09:20 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 36,097
Karma: 15014853
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
kovidgoyal is offline   Reply With Quote
Advert
Old 10-31-2019, 10:51 AM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 18,400
Karma: 30695818
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.
davidfor is offline   Reply With Quote
Old 10-31-2019, 07:46 PM   #4
kylecarroll
Junior Member
kylecarroll began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
Thanks, Kovid! Using the customize tool worked.
kylecarroll is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import on Filename changes mid import due to book error Vortex Calibre 3 12-05-2014 12:49 PM
Import Author And Title From Filename & Import Other Tags And Cover From File DazJWood Library Management 22 07-18-2014 10:22 AM
Failing to import cover from most CBR snipe2004 Library Management 7 03-14-2014 05:35 AM
Import failed Error:404 when attempting to import from Calibre to Stanza dvond Apple Devices 0 05-13-2011 04:00 PM
new plugins and using import KevinH Plugins 4 05-10-2011 12:48 AM


All times are GMT -4. The time now is 04:33 PM.


MobileRead.com is a privately owned, operated and funded community.