apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.54k stars 1.52k forks source link

Can't convert - "No module named 'Crypto' #2219

Open GlenHenshaw opened 1 year ago

GlenHenshaw commented 1 year ago

CheckList


Title

My Environment

Ubuntu Jammy

Calibre: Version

Calibre 5.37.0

Kindle: Version

Oasis

DeDRM: Version

7.2.1

Log

Log Title ```log Added A Great and Terrible King: Edward I and the Forging of Britain to db in: 0.1 Added 1 books in 0.7 seconds Worker Launch took: 0.02 seconds Job: 1 Convert book 1 of 1 (A Great and Terrible King: Edward I and the Forging of Britain) finished Convert book 1 of 1 (A Great and Terrible King: Edward I and the Forging of Britain) DeDRM v7.2.1: Trying to decrypt m_aa8uz0.azw3 Using Library AlfCrypto DLL/DYLIB/SO Using Library AlfCrypto DLL/DYLIB/SO Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 18, in from ion import DrmIon, DrmIonVoucher File "/tmp/calibre_5.37.0_tmp_949uicag/pa9a4it9plugin_unzip/ion.py", line 33, in from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 175, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.__init__", line 633, in run decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook) File "calibre_plugins.dedrm.__init__", line 527, in KindleMobiDecrypt import calibre_plugins.dedrm.k4mobidedrm File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module exec(compiled, module.__dict__) File "calibre_plugins.dedrm.k4mobidedrm", line 88, in from calibre_plugins.dedrm import kfxdedrm File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module exec(compiled, module.__dict__) File "calibre_plugins.dedrm.kfxdedrm", line 20, in from calibre_plugins.dedrm.ion import DrmIon, DrmIonVoucher File "/usr/lib/calibre/calibre/customize/zipplugin.py", line 191, in exec_module exec(compiled, module.__dict__) File "calibre_plugins.dedrm.ion", line 33, in from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto' Conversion options changed from defaults: cover: '/tmp/calibre_5.37.0_tmp_949uicag/32ipieio.jpeg' pdf_sans_family: 'Nimbus Sans [urw]' output_profile: 'kindle_voyage' verbose: 2 read_metadata_from_opf: '/tmp/calibre_5.37.0_tmp_949uicag/_vr_woxy.opf' pdf_serif_family: 'Nimbus Roman [urw]' Resolved conversion options calibre version: 5.37.0 {'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 0.0, 'book_producer': None, 'change_justification': 'original', 'chapter': "//*[((name()='h1' or name()='h2') and re:test(., " "'\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', " "'i')) or @class = 'chapter']", 'chapter_mark': 'pagebreak', 'comments': None, 'cover': '/tmp/calibre_5.37.0_tmp_949uicag/32ipieio.jpeg', 'custom_size': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'filter_css': '', 'fix_indents': True, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': , 'insert_blank_line': False, 'insert_blank_line_size': 0.5, 'insert_metadata': False, 'isbn': None, 'italicize_common_cases': True, 'keep_ligatures': False, 'language': None, 'level1_toc': None, 'level2_toc': None, 'level3_toc': None, 'line_height': 0.0, 'linearize_tables': False, 'margin_bottom': 5.0, 'margin_left': 5.0, 'margin_right': 5.0, 'margin_top': 5.0, 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_inline_navbars': False, 'output_profile': , 'page_breaks_before': "//*[name()='h1' or name()='h2']", 'paper_size': 'letter', 'pdf_add_toc': False, 'pdf_default_font_size': 20, 'pdf_footer_template': None, 'pdf_header_template': None, 'pdf_hyphenate': False, 'pdf_mark_links': False, 'pdf_mono_family': 'Courier', 'pdf_mono_font_size': 16, 'pdf_odd_even_offset': 0.0, 'pdf_page_margin_bottom': 72.0, 'pdf_page_margin_left': 72.0, 'pdf_page_margin_right': 72.0, 'pdf_page_margin_top': 72.0, 'pdf_page_number_map': None, 'pdf_page_numbers': False, 'pdf_sans_family': 'Nimbus Sans [urw]', 'pdf_serif_family': 'Nimbus Roman [urw]', 'pdf_standard_font': 'serif', 'pdf_use_document_margins': False, 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': '/tmp/calibre_5.37.0_tmp_949uicag/_vr_woxy.opf', 'remove_fake_margins': True, 'remove_first_image': False, 'remove_paragraph_spacing': False, 'remove_paragraph_spacing_indent_size': 1.5, 'renumber_headings': True, 'replace_scene_breaks': '', 'search_replace': '[]', 'series': None, 'series_index': None, 'smarten_punctuation': False, 'sr1_replace': None, 'sr1_search': None, 'sr2_replace': None, 'sr2_search': None, 'sr3_replace': None, 'sr3_search': None, 'start_reading_at': None, 'subset_embedded_fonts': False, 'tags': None, 'timestamp': None, 'title': None, 'title_sort': None, 'toc_filter': None, 'toc_threshold': 6, 'toc_title': None, 'transform_css_rules': '[]', 'transform_html_rules': '[]', 'uncompressed_pdf': False, 'unit': 'inch', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'use_profile_size': False, 'verbose': 2} DeDRM v7.2.1: Trying to decrypt m_aa8uz0.azw3 Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre_plugins.dedrm.kfxdedrm", line 18, in from ion import DrmIon, DrmIonVoucher File "/tmp/calibre_5.37.0_tmp_949uicag/_qdhjpmxplugin_unzip/ion.py", line 33, in from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto' ```
ElleKayEm commented 1 year ago

Use the official Linux calibre. There's also a newer version of DeDRM here: https://github.com/noDRM/DeDRM_tools/releases/tag/v10.0.3

GlenHenshaw commented 1 year ago

...I'm using the Calibre that gets installed via Ubuntu's apt-get package manager. Is that not the official Linux version?

ElleKayEm commented 1 year ago

Official version here: https://calibre-ebook.com/download_linux

mabequinho commented 6 months ago

You would need to install pycrypto, fortunately Fedora still packages it. No success with pycryptodomex.

ElleKayEm commented 6 months ago

Official Linux calibre has its own embedded Python.

mabequinho commented 6 months ago

Official Linux calibre has its own embedded Python.

I sincerely apologize for persistently raising an issue that has already been discussed across multiple threads. But I still find more convenient to run workarounds using the packaged versions.

ElleKayEm commented 6 months ago

No problem. Just suggested it because it solves this issue.