![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,378
Karma: 203720150
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 Thanks. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,378
Karma: 203720150
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,213
Karma: 27110894
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. |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,378
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,213
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah, apparently pycrypto requires distutils, I'll upload a fixed build in a bit.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,378
Karma: 203720150
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. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,213
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,378
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
That did it. I thank you sir!
![]() |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,499
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Any chance this issue still exists in the calibre-portable version? Thanks, |
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,213
Karma: 27110894
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
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |