Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
600 stars 23 forks source link

"No module named libadobe" #16

Closed DUOLabs333 closed 2 years ago

DUOLabs333 commented 2 years ago

Bug description

I tried to install DeACSM, but it failed with:

calibre, version 5.35.0
ERROR: Install plugin failed: A problem occurred while installing this plugin. This plugin will now be uninstalled. Please post the error message in details below into the forum thread for this plugin and restart calibre.

Traceback (most recent call last):
  File "calibre_plugins.deacsm.__init__", line 184, in initialize
    from calibre_plugins.deacsm.libadobe import createDeviceKeyFile, update_account_path
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.deacsm.libadobe", line 18, in <module>
    from Crypto.Cipher import AES
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/usr/lib/python3.10/site-packages/Crypto/Util/_raw_api.py", line 81, in <module>
    ffi = FFI()
  File "/home/system/.local/lib/python3.10/site-packages/cffi/api.py", line 54, in __init__
    raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
Exception: Version mismatch: this is the 'cffi' package version 1.14.6, located in '/home/system/.local/lib/python3.10/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3.10/site-packages/_cffi_backend.cpython-310-aarch64-linux-gnu.so'.  The two versions should be equal; check your installation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/customize/ui.py", line 673, in initialize_plugin
    p.initialize()
  File "calibre_plugins.deacsm.__init__", line 187, in initialize
    from libadobe import createDeviceKeyFile, update_account_path
ModuleNotFoundError: No module named 'libadobe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/dialogs/plugin_updater.py", line 712, in _install_clicked
    plugin = add_plugin(zip_path)
  File "/usr/lib/calibre/calibre/customize/ui.py", line 483, in add_plugin
    plugin = initialize_plugin(plugin, path_to_zip_file, PluginInstallationType.EXTERNAL)
  File "/usr/lib/calibre/calibre/customize/ui.py", line 678, in initialize_plugin
    raise InvalidPlugin((_('Initialization of plugin %s failed with traceback:')
calibre.customize.InvalidPlugin: Initialization of plugin Traceback (most recent call last):
  File "calibre_plugins.deacsm.__init__", line 184, in initialize
    from calibre_plugins.deacsm.libadobe import createDeviceKeyFile, update_account_path
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.deacsm.libadobe", line 18, in <module>
    from Crypto.Cipher import AES
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/usr/lib/python3.10/site-packages/Crypto/Util/_raw_api.py", line 81, in <module>
    ffi = FFI()
  File "/home/system/.local/lib/python3.10/site-packages/cffi/api.py", line 54, in __init__
    raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
Exception: Version mismatch: this is the 'cffi' package version 1.14.6, located in '/home/system/.local/lib/python3.10/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3.10/site-packages/_cffi_backend.cpython-310-aarch64-linux-gnu.so'.  The two versions should be equal; check your installation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/customize/ui.py", line 673, in initialize_plugin
    p.initialize()
  File "calibre_plugins.deacsm.__init__", line 187, in initialize
    from libadobe import createDeviceKeyFile, update_account_path
ModuleNotFoundError: No module named 'libadobe'
 failed with traceback:
Traceback (most recent call last):
  File "calibre_plugins.deacsm.__init__", line 184, in initialize
    from calibre_plugins.deacsm.libadobe import createDeviceKeyFile, update_account_path
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.deacsm.libadobe", line 18, in <module>
    from Crypto.Cipher import AES
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/usr/lib/python3.10/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/usr/lib/python3.10/site-packages/Crypto/Util/_raw_api.py", line 81, in <module>
    ffi = FFI()
  File "/home/system/.local/lib/python3.10/site-packages/cffi/api.py", line 54, in __init__
    raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation." % (
Exception: Version mismatch: this is the 'cffi' package version 1.14.6, located in '/home/system/.local/lib/python3.10/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3.10/site-packages/_cffi_backend.cpython-310-aarch64-linux-gnu.so'.  The two versions should be equal; check your installation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/customize/ui.py", line 673, in initialize_plugin
    p.initialize()
  File "calibre_plugins.deacsm.__init__", line 187, in initialize
    from libadobe import createDeviceKeyFile, update_account_path
ModuleNotFoundError: No module named 'libadobe'

Operating system

Linux

Which version of Calibre are you running?

5.35

Which version of the DeACSM plugin are you running?

v0.0.15

Further information

No response

Leseratte10 commented 2 years ago

This here seems to be the actual error message: Exception: Version mismatch: this is the 'cffi' package version 1.14.6, located in '/home/system/.local/lib/python3.10/site-packages/cffi/api.py'. When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/lib/python3.10/site-packages/_cffi_backend.cpython-310-aarch64-linux-gnu.so'. The two versions should be equal; check your installation.

Looks like you've got some version mismatch in your Python environment, this does not look like an error with my plugin. Try removing the locally-installed python3.10 from your /home directory and use the system one and see if that helps.

DUOLabs333 commented 2 years ago

Yeah, I deleted cffi from my local Python3 installation, and it worked.