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 06-11-2011, 07:47 AM   #1
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,743
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Calibre 0.8.5 - my plugin quit working

I have a plugin that imports pycrypto (included with Windows calibre) from the calibre2 lib (site-lib?) directory. It just uses the simple:
Code:
from Crypto.Cipher import AES as _AES
from Crypto.PublicKey import RSA as _RSA
The plugin worked fine with calibre 0.8.4, but doesn't work with 0.8.5. Is there anything I special I need to do to import from the pylib.zip zipfile—where all the libraries seem to have moved in 0.8.5—from within a plugin? Do I need to append something to the sys.path? Or is there something wrong with the pycrypto compiled libs included with calibre 0.8.5 (windows)?

Thanks.
DiapDealer is online now   Reply With Quote
Old 06-11-2011, 09:05 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,743
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It looks like it may have something to do with the Crypto folder's (in the Windows Calibre distro) move from pydlib to pylib.zip in 0.8.5. Will those libraries be available for import in a plugin if pylib.zip is included in sys.path (as seems to be the case)?

Last edited by DiapDealer; 06-11-2011 at 09:10 AM.
DiapDealer is online now   Reply With Quote
Old 06-11-2011, 10:06 AM   #3
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: 25,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It should just import. Run

calibre-debug -c "from Crypto.Cipher import AES as _AES"

to see what the error is.
kovidgoyal is offline   Reply With Quote
Old 06-11-2011, 10:40 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,743
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by kovidgoyal
It should just import. Run

calibre-debug -c "from Crypto.Cipher import AES as _AES"

to see what the error is.
Code:
C:\>calibre-debug -c "from Crypto.Cipher import AES as _AES"
Python function terminated unexpectedly
  No module named distutils.util (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 132, in main
  File "site.py", line 109, in run_entry_point
  File "site-packages\calibre\debug.py", line 215, in main
  File "<string>", line 1, in <module>
  File "site.py", line 50, in load_module
  File "site-packages\pycrypto-2.3-py2.7-win32.egg\Crypto\Cipher\AES.py", line 7, in <module>
  File "site-packages\pycrypto-2.3-py2.7-win32.egg\Crypto\Cipher\AES.py", line 3, in __bootstrap__
  File "site.py", line 50, in load_module
  File "site-packages\pkg_resources.py", line 698, in <module>
  File "site-packages\pkg_resources.py", line 701, in Environment
  File "site-packages\pkg_resources.py", line 96, in get_supported_platform
  File "site-packages\pkg_resources.py", line 221, in get_build_platform
ImportError: No module named distutils.util
DiapDealer is online now   Reply With Quote
Old 06-11-2011, 10:42 AM   #5
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: 25,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah, apparently pycrypto requires distutils, I'll upload a fixed build in a bit.
kovidgoyal is offline   Reply With Quote
Old 06-11-2011, 10:49 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,743
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No hurry. Thanks for looking into it.
I could include my own stripped down version of pycrypto libs (and any dependencies) in the plugin pretty easily, but it seemed like overkill since it was already included as part of calibre's Windows binary install.

Thanks again!

Last edited by DiapDealer; 06-11-2011 at 10:53 AM.
DiapDealer is online now   Reply With Quote
Old 06-11-2011, 11:59 AM   #7
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: 25,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've uploaded a fixed build. At least your two import statements work, I haven't tested it beyond that.
kovidgoyal is offline   Reply With Quote
Old 06-11-2011, 02:00 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,743
Karma: 39252809
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
That did it. I thank you sir!
DiapDealer is online now   Reply With Quote
Old 06-16-2011, 02:11 AM   #9
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 786
Karma: 308454
Join Date: Nov 2009
Device: many
Hi,

Any chance this issue still exists in the calibre-portable version?

Thanks,
KevinH is offline   Reply With Quote
Old 06-16-2011, 03:03 AM   #10
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: 25,352
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, both were rebuilt. You can check that there should be no AES.pyo file in pylib.zip
kovidgoyal 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
I09 plugin stopped working phil_ga Recipes 2 02-18-2011 09:53 AM
How to you quit calibre DaleDe Calibre 4 02-02-2009 05:24 PM
Quit from SysTray Not Working? NigelS Calibre 2 12-18-2008 12:26 PM


All times are GMT -4. The time now is 10:00 AM.


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