xxyzz / WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.
https://xxyzz.github.io/WordDumb/
GNU General Public License v3.0
376 stars 19 forks source link

WordDumb Error #179

Closed angellyic closed 8 months ago

angellyic commented 8 months ago

Checkboxes

Describe the bug

I selected the book and then clicked on the plugin icon, but it immediately showed this error. Please bear with me as I may be slow at understanding code and whatnot! I'm not sure if I made a mistake in the process of downloading this plugin?

Operating System name and version

MacOs Ventura 13.0

Python version

3.12.1

calibre version

7.3.0

WordDumb plugin version

3.30.0

Error message

calibre, version 7.3.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Magnolia Parks 
Job: "Generating Word Wise and X-Ray for Magnolia Parks" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 202, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 56, in run_subprocess
    return subprocess.run(
           ^^^^^^^^^^^^^^^
  File "subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip', '{"book_id": 2, "book_path": "/Users/xr/Applications/Jessa Hastings/Magnolia Parks (2)/Magnolia Parks - Jessa Hastings.kfx", "mi": null, "book_fmt": "KFX", "book_lang": "en", "useragent": "WordDumb/3.30.0 (https://github.com/xxyzz/WordDumb)", "plugin_path": "/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip", "spacy_model": "en_core_web_md", "create_ww": true, "create_x": true, "asin": "B096H6XVQ8", "acr": "CR!RUAGEM1KE9MCZRCNPMKO9K5CSKHQ", "revision": "", "kfx_json": null, "mobi_html": null, "mobi_codec": ""}', '{"use_pos": true, "search_people": false, "model_size": "md", "zh_wiki_variant": "cn", "fandom": "", "add_locator_map": false, "preferred_formats": ["KFX", "AZW3", "AZW", "MOBI", "EPUB"], "use_all_formats": false, "minimal_x_ray_count": 1, "en_ipa": "ga_ipa", "zh_ipa": "pinyin", "choose_format_manually": true, "wiktionary_gloss_lang": "en", "kindle_gloss_lang": "en", "use_gpu": false, "cuda": "cu121", "last_opened_kindle_lemmas_language": "ca", "last_opened_wiktionary_lemmas_language": "ca", "use_wiktionary_for_kindle": false, "python_path": "", "ca_wiktionary_difficulty_limit": 5, "da_wiktionary_difficulty_limit": 5, "de_wiktionary_difficulty_limit": 5, "el_wiktionary_difficulty_limit": 5, "en_wiktionary_difficulty_limit": 5, "es_wiktionary_difficulty_limit": 5, "fi_wiktionary_difficulty_limit": 5, "fr_wiktionary_difficulty_limit": 5, "hr_wiktionary_difficulty_limit": 5, "it_wiktionary_difficulty_limit": 5, "ja_wiktionary_difficulty_limit": 5, "ko_wiktionary_difficulty_limit": 5, "lt_wiktionary_difficulty_limit": 5, "mk_wiktionary_difficulty_limit": 5, "nl_wiktionary_difficulty_limit": 5, "no_wiktionary_difficulty_limit": 5, "pl_wiktionary_difficulty_limit": 5, "pt_wiktionary_difficulty_limit": 5, "ro_wiktionary_difficulty_limit": 5, "ru_wiktionary_difficulty_limit": 5, "sl_wiktionary_difficulty_limit": 5, "sv_wiktionary_difficulty_limit": 5, "uk_wiktionary_difficulty_limit": 5, "zh_wiktionary_difficulty_limit": 5}']' returned non-zero exit status 1.

Called with args: (ParseJobData(book_id=2, book_path='/Users/xr/Applications/Jessa Hastings/Magnolia Parks (2)/Magnolia Parks - Jessa Hastings.kfx', mi=<calibre.ebooks.metadata.book.base.Metadata object at 0x10c3b5010>, book_fmt='KFX', book_lang='en', useragent='WordDumb/3.30.0 (https://github.com/xxyzz/WordDumb)', plugin_path='/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip', spacy_model='en_core_web_md', create_ww=True, create_x=True, asin='B096H6XVQ8', acr='CR!RUAGEM1KE9MCZRCNPMKO9K5CSKHQ', revision='', kfx_json=None, mobi_html=None, mobi_codec=''),) {'notifications': <queue.Queue object at 0x10c3570d0>, 'abort': <threading.Event at 0x10c396290: unset>, 'log': <calibre.utils.logging.GUILog object at 0x12a285b10>} 
Traceback (most recent call last):
  File "/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip/dump_lemmas.py", line 5, in <module>
ImportError: attempted relative import with no known parent package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip/__main__.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip/dump_lemmas.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/Users/xr/Library/Preferences/calibre/plugins/WordDumb.zip/utils.py", line 51, in <module>
TypeError: unsupported operand type(s) for |: 'type' and 'type'

Plugin settings and reproduce steps

  1. converted epub to kfx on callibre
  2. plugged in kindle
  3. clicked on worddumb

Generated files, screenshots or videos

No response

xxyzz commented 8 months ago

You're using Python 3.9, please upgrade to 3.11 or 3.12: https://xxyzz.github.io/WordDumb/installation.html#install-python-3-11-and-pip

angellyic commented 8 months ago

It worked! I was supposed to download Homebrew with terminal and use the command provided, instead I just searched Python up and downloaded it from there, which was my bad. Thank you!