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
386 stars 19 forks source link

Tonnerre de Brest!: The plugin works for Word Wise, but not for X-Ray #90

Closed ThaayP closed 1 year ago

ThaayP commented 1 year ago

Checkboxes

Describe the bug

Since I updated both Calibre and plugin a couple of days ago, I always get the same error message over and over, saying that there's an error while creating the X-Ray feature for the books. I followed the plugin guide, and even the settings are the same, and I noticed that Word Wise was okay for the books I tried.

I've tried everything: uninstalling the plugin, updating Python, restarting the program and my computer and nothing worked. Not only that, but I even tried with different book formats (epub, azw3, mobi), and got nothing. I also tried posting on Reddit and people there told me to post in here and MobileRead Forum, so here I am! I'm not a techie or anything like that, so what do I do now?

System Information

OS: Windows 10 Pro 32bit Calibre: version 6.9.0 64bit Python: version 3,11,0 64bit Plugin: version 3.27.1

Error message

**_calibre, version 6.9.0 (win32, 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 Queen Move

Job: "Generating Word Wise and X-Ray for Queen Move" 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 111, in do_job

File "calibre_plugins.worddumb.deps", line 47, in install_deps

File "calibre_plugins.worddumb.deps", line 134, in pip_install

File "calibre_plugins.worddumb.utils", line 47, in run_subprocess

File "[subprocess.py](https://subprocess.py/)", line 524, in run

subprocess.CalledProcessError: Command '['calibre-debug', '-e', 'C:/Users/Thais/__pip-runner__.py', '--', '--disable-pip-version-check', 'install', '-U', '-t', WindowsPath('C:/Users/Thais Passos/AppData/Roaming/calibre/plugins/worddumb-libs-py3.10'), '--no-user', 'rapidfuzz==2.13.2']' returned non-zero exit status 1.

Called with args: ((258, 'AZW3', 'C:\\Users\\Thais Passos\\Calibre Library\\Kennedy Ryan\\Queen Move (258)\\Queen Move - Kennedy Ryan.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x000002A33FE8CB20>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), True, True) {'notifications': <queue.Queue object at 0x000002A340F8D570>, 'abort': <threading.Event object at 0x000002A340F8D450>, 'log': <calibre.utils.logging.GUILog object at 0x000002A340F8C8B0>}

Traceback (most recent call last):

File "[runpy.py](https://runpy.py/)", line 196, in _run_module_as_main

File "[runpy.py](https://runpy.py/)", line 86, in _run_code

File "[site.py](https://site.py/)", line 83, in <module>

File "[site.py](https://site.py/)", line 78, in main

File "[site.py](https://site.py/)", line 50, in run_entry_point

File "calibre\[debug.py](https://debug.py/)", line 275, in main

File "calibre\[debug.py](https://debug.py/)", line 208, in run_script

File "polyglot\[builtins.py](https://builtins.py/)", line 107, in exec_path

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Thais\\__pip-runner__.py'**

Reproduce steps

  1. Click on plugin to start creating Word Wise and X-Ray
  2. Wait a couple of seconds
  3. See an error message "Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub."

Screenshots or videos

No response

miiPoP commented 1 year ago

Metoo, same error. I just noticed we both have a blank in our user name. And the second part is absent from the FileNotFound path. Is this related?

xxyzz commented 1 year ago

Ah... right, the space in your user names. I split the "pip --version" command output by space, and clearly it also splits at user names and break the pip file path.

xxyzz commented 1 year ago

Could you confirm the above commit resolves the FileNotFoundError error?

miiPoP commented 1 year ago

Qapla', works fine now. Thanks.

ThaayP commented 1 year ago

Where do I get this pip thing? Is it on the Python for Windows download page? I'm not a techie, and I followed the steps for Windows.

[Edit} It seems I already have this pip thing in my computer (version 22.3). I opened a command prompt and searched for it, thanks to a guide on the Internet, and it's showing that I have it because it shows a menu and lots of different options. So what's next?

xxyzz commented 1 year ago

The default install setting("Install Now" button) in the Python installer will install pip.

You can find the test plugin zip file from GitHub Actions Artifacts: https://github.com/xxyzz/WordDumb/actions/runs/3588500837. Then install the test plugin in calibre GUI or command calibre-customize -a worddumb.zip.

ThaayP commented 1 year ago

After downloading the test plugin zip file, I installed it on Calibre and then decided to test it with six different books on Calibre (it worked well with four of them, and two showed the same Tonnere de Brest! error message). Should I worry about that or?

xxyzz commented 1 year ago

Please post the error messages. I don't think they would be the same as the error message in your first comment.

ThaayP commented 1 year ago

image

ThaayP commented 1 year ago

And when I click to see more, I get this message for both books:

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

Starting job: Generating X-Ray for King of Battle and Blood Job: "Generating X-Ray for King of Battle and Blood" 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 168, in do_job File "calibre_plugins.worddumb.parse_job", line 303, in create_files File "calibre_plugins.worddumb.x_ray", line 189, in finish File "calibre_plugins.worddumb.mediawiki", line 322, in query_mediawiki File "calibre_plugins.worddumb.mediawiki", line 127, in query File "calibre_plugins.worddumb.mediawiki", line 171, in get_section_text UnboundLocalError: local variable 'e' referenced before assignment

Called with args: ((288, 'AZW3', 'C:\Users\Thais Passos\Calibre Library\Scarlett St. Clair\King of Battle and Blood (288)\King of Battle and Blood - Scarlett St. Clair.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001EB02A77BE0>, {'spacy': 'en_coreweb', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), False, True) {'notifications': <queue.Queue object at 0x000001EB02A77190>, 'abort': <threading.Event object at 0x000001EB02A77310>, 'log': <calibre.utils.logging.GUILog object at 0x000001EB02A773D0>}

and

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

Starting job: Generating X-Ray for A Touch of Malice Job: "Generating X-Ray for A Touch of Malice" 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 168, in do_job File "calibre_plugins.worddumb.parse_job", line 303, in create_files File "calibre_plugins.worddumb.x_ray", line 189, in finish File "calibre_plugins.worddumb.mediawiki", line 322, in query_mediawiki File "calibre_plugins.worddumb.mediawiki", line 127, in query File "calibre_plugins.worddumb.mediawiki", line 171, in get_section_text UnboundLocalError: local variable 'e' referenced before assignment

Called with args: ((286, 'AZW3', 'C:\Users\Thais Passos\Calibre Library\Scarlett St. Clair\A Touch of Malice (286)\A Touch of Malice - Scarlett St. Clair.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001EB02A76A10>, {'spacy': 'en_coreweb', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), False, True) {'notifications': <queue.Queue object at 0x000001EB02A766B0>, 'abort': <threading.Event object at 0x000001EB02B4A710>, 'log': <calibre.utils.logging.GUILog object at 0x000001EB02B4A860>}

xxyzz commented 1 year ago

This error should be fixed by https://github.com/xxyzz/WordDumb/commit/117d064104bb761e30442d83c7f15fe2fbf35993.

ThaayP commented 1 year ago

Do I put this on the command prompt?

xxyzz commented 1 year ago

You only need to install the zip file from GitHub Actions Artifacts https://github.com/xxyzz/WordDumb/actions/runs/3611180794.

ThaayP commented 1 year ago

But I did! It even worked with some of the books I was converting :s

xxyzz commented 1 year ago

You need to install the new zip file from the above link, that zip file contains the changed code which should fix the "UnboundLocalError" error. Every time when new code pushed, GitHub Actions will upload new zip file at here.

ThaayP commented 1 year ago

I just noticed that it's a different file from the one I downloaded earlier. I'm installing it right now and testing with the same two books, and it worked so far. If it happens again, should I follow the same steps?

xxyzz commented 1 year ago

You can create new issue on GitHub if you encounter new errors in the future. I don't think you would get the same error again. Since the bugs are resolved, I'll close this issue now.