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
593 stars 23 forks source link

ModuleNotFoundError: No module named 'libadobe' #72

Closed alexreg closed 1 month ago

alexreg commented 7 months ago

Bug description

To reproduce:

  1. Clone Git repo.
  2. Run bundle_calibre_plugin.sh script.
  3. Install plugin calibre-plugin.zip in Calibre.
  4. Observe the following error. (Full log below.)
Initialization of plugin Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'

Operating system

MacOS

Which version of Calibre are you running?

7.0.0

Which version of the ACSM Input plugin are you running?

Git master branch

Import type

No response

Further information

calibre, version 7.0.0
ERROR: Unhandled exception: <b>InvalidPlugin</b>:Initialization of plugin Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'
 failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'

calibre 7.0  embedded-python: True
macOS-14.1-arm64-arm-64bit Darwin ('64bit', '')
('Darwin', '23.1.0', 'Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000')
Python 3.11.5
OSX: ('14.1', ('', '', ''), 'arm64')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 9) && Obok DeDRM (10, 0, 9) && ACSM Input Plugin GUI Extension (0, 1, 0)
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/gui2/preferences/plugins.py", line 325, in add_plugin
  File "calibre/customize/ui.py", line 520, in add_plugin
  File "calibre/customize/ui.py", line 715, in initialize_plugin
calibre.customize.InvalidPlugin: Initialization of plugin Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'
 failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 288, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
ModuleNotFoundError: No module named 'libadobe'
Leseratte10 commented 7 months ago

Did you have a previous version of the plugin installed or is this a clean install? Does this also happen after restarting Calibre?

alexreg commented 7 months ago

Clean install. And yes, happens after restarting, I'm afraid.

maneatingduck commented 7 months ago

I got the same error when trying a clean install of the plugin (never used it before) with calibre portable 7.1.0.

I downgraded calibre to 6.29 portable, and the plugin installed without errors and works fine.

Wonderful plugin btw, thanks for maintaining it :)

Leseratte10 commented 7 months ago

Interesting. Are you on MacOS as well?

I don't think I have tested a clean install on Calibre 7 yet, I've just updated from 6.x and made sure it still works.

maneatingduck commented 7 months ago

I'm on Windows 11. Edit: I upgraded calibre to 7.1.0 again, plugin still works.

alexreg commented 7 months ago

Error still occurs for me on Calibre 7.1 on macOS.

Leseratte10 commented 7 months ago

Interesting. I completely removed the plugin from Calibre, updated 7.1, installed it again, and it still just worked fine (on Linux). I'm going to set up a VM to try a clean new install of Calibre 7.1 where it was never installed in the past.

vasi commented 1 month ago

I'm experiencing the same issue on FreeBSD. It looks like the plugin zip file is not being added to sys.path, while on Linux it is, and I'm really not sure why.

Anyhow I think the correct way to load modules within a plugin is with the magic prefix, eg: calibre_plugins.deacsm.libadobe. If I change all imports to look like that, it works fine! But then the test fails of course. Let me see if there's a way to fix that.

vasi commented 1 month ago

Welp, the tests don't run on FreeBSD anyhow, because there's no legacy algorithm support in libcrypto. It looks like the tests use rc2-cbc-pkcs5.

alexreg commented 1 month ago

Any update on this yet?

alexreg commented 1 month ago

Works nicely for me now, I'm glad to say; thanks!