|
|
#1 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 448
Karma: 3000000
Join Date: Nov 2020
Device: none
|
Can't import Crypto.Cipher
I'm testing calibre 5.5 on linux and mac and get the following error:
Code:
$ calibre-debug
Welcome to the interactive calibre shell!
Use exit to quit
>>> from Crypto.Cipher import AES
Traceback (most recent call last):
File "calibre/utils/ipython.py", line 191, in ipython
ModuleNotFoundError: No module named 'IPython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "bypy-importer.py", line 154, in exec_module
File "Crypto/Cipher/__init__.py", line 27, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "bypy-importer.py", line 154, in exec_module
File "Crypto/Cipher/_mode_ecb.py", line 35, in <module>
File "Crypto/Util/_raw_api.py", line 308, in load_pycryptodome_raw_lib
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cpython-38-darwin.so': dlopen(/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.cpython-38-darwin.so, 6): no suitable image found. Did find:
/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.cpython-38-darwin.so: stat() failed with errno=20, Trying '_raw_ecb.abi3.so': dlopen(/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.abi3.so, 6): no suitable image found. Did find:
/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.abi3.so: stat() failed with errno=20, Trying '_raw_ecb.so': dlopen(/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.so, 6): no suitable image found. Did find:
/Applications/calibre.app/Contents/Frameworks/plugins/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.so: stat() failed with errno=20
|
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,622
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
because pycryptodome does some silly ctypes/cffi based nonsense to load native modules instead of using the python import mechanism. That's not going to work with a frozen python build.
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,622
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
and this will fix it: https://github.com/kovidgoyal/calibr...1fad25ccc1f4bf
|
|
|
|
|
|
#4 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 448
Karma: 3000000
Join Date: Nov 2020
Device: none
|
Thanks! I was suspect it has something to do with bypy but didn't see that `return {}`.
|
|
|
|
![]() |
|
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 |
| Recipe request: Crypto-Gram | NSILMike | Recipes | 0 | 09-15-2018 01:32 PM |
| The Serpentine Cipher - Dan Brown's next book | Nate the great | Reading Recommendations | 14 | 09-17-2009 01:00 PM |