| 
			
			 | 
		#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
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				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
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905 
				Karma: 47303824 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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 11:18 AM | 
| Import on Filename changes mid import due to book error | Vortex | Calibre | 3 | 12-05-2014 12:49 PM | 
| 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 |