Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-25-2020, 08:32 AM   #1
xxyzz
Evangelist
xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.
 
Posts: 439
Karma: 2666666
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
I find pycryptodome in the /bypy/sources.json file so I guess calibre should have this library but don't know why I can't use it.
xxyzz is offline   Reply With Quote
Old 11-25-2020, 10:01 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: 45,182
Karma: 27110894
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-25-2020, 10:30 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: 45,182
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
and this will fix it: https://github.com/kovidgoyal/calibr...1fad25ccc1f4bf
kovidgoyal is offline   Reply With Quote
Old 11-25-2020, 07:30 PM   #4
xxyzz
Evangelist
xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.
 
Posts: 439
Karma: 2666666
Join Date: Nov 2020
Device: none
Thanks! I was suspect it has something to do with bypy but didn't see that `return {}`.
xxyzz is offline   Reply With Quote
Reply


Forum Jump

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 10:18 AM
Recipe request: Crypto-Gram NSILMike Recipes 0 09-15-2018 12:32 PM
The Serpentine Cipher - Dan Brown's next book Nate the great Reading Recommendations 14 09-17-2009 12:00 PM


All times are GMT -4. The time now is 04:07 AM.


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