Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message on macOS 13.1 (M2) #98

Closed
2 tasks done
brock27625 opened this issue Dec 29, 2022 · 15 comments
Closed
2 tasks done

Error message on macOS 13.1 (M2) #98

brock27625 opened this issue Dec 29, 2022 · 15 comments

Comments

@brock27625
Copy link

Checkboxes

  • I have read the README file.
  • I have not found similar issue or disscussion at GitHub.

Describe the bug

I can't process any books; I get the same error as pasted below.

I am sorry in advance if this is a dumb issue - I am very inexperienced with this stuff. I followed the instructions as best I could (had some trouble using Brew, so installed Command Line Tools).

Thanks!

System Information

OS: macOS Ventura 13.1 (M2)
Calibre: 6.10.0
Python: Version 3.11.1 (3.11.1)
Plugin: 3.28.1

Error message

calibre, version 6.10.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 Death's End 
Job: "Generating Word Wise and X-Ray for Death's End" 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 167, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 59, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', 'B00WDVKZY0', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", "Death's_End", 'bc309994', 'en_core_web_md', 'en', 'en', 'utf-8', 'WordDumb/3.28.1 (https://github.com/xxyzz/WordDumb)', 'cn', '', 'AZW3', '1', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x', '-s']' returned non-zero exit status 1.
 
Called with args: ((114, 'AZW3', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", <calibre.ebooks.metadata.book.base.Metadata object at 0x154077880>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), True, True) {'notifications': <queue.Queue object at 0x154075e70>, 'abort': <threading.Event object at 0x154075270>, 'log': <calibre.utils.logging.GUILog object at 0x154077550>} 
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/brockellett/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/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/dump_kindle_lemmas.py", line 13, in <module>
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Reproduce steps

  1. Select book
  2. Push on the WordDumb button in Calibre
  3. Issue presents

Screenshots or videos

No response

@xxyzz
Copy link
Owner

xxyzz commented Dec 29, 2022

Python 3.9 is not supported. Please update your Python package to 3.10 or newer version via Homebrew.

@xxyzz xxyzz closed this as completed Dec 29, 2022
@brock27625
Copy link
Author

Python 3.9 is not supported. Please update your Python package to 3.10 or newer version via Homebrew.

Thanks for your quick reply. I reinstalled Python 3.10 via Homebrew and now have a new error which asks me to delete the users/x/library/preferences/calibre/plugins/worddumb-libs-py* folder and then try again. I delete all libs-py* folders, restart calibre but it just keeps recurring

@brock27625
Copy link
Author

Python 3.9 is not supported. Please update your Python package to 3.10 or newer version via Homebrew.

Thanks for your quick reply. I reinstalled Python 3.10 via Homebrew and now have a new error which asks me to delete the users/x/library/preferences/calibre/plugins/worddumb-libs-py* folder and then try again. I delete all libs-py* folders, restart calibre but it just keeps recurring

image

Starting job: Generating Word Wise and X-Ray for The Dark Forest
Job: "Generating Word Wise and X-Ray for The Dark Forest" 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 167, in do_job
run_subprocess(args, input_str)
File "calibre_plugins.worddumb.utils", line 59, in run_subprocess
return subprocess.run(
File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/opt/homebrew/bin/python3', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', 'BBQ778TB8M', '/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/The Dark Forest (113)/The Dark Forest - Cixin Liu.mobi', 'The_Dark_Forest', '9c52008f', 'en_core_web_md', 'en', 'en', 'utf-8', 'WordDumb/3.28.1 (https://github.com/xxyzz/WordDumb)', 'cn', '', 'MOBI', '1', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x', '-s']' returned non-zero exit status 1.

Called with args: ((113, 'MOBI', '/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/The Dark Forest (113)/The Dark Forest - Cixin Liu.mobi', , {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), True, True) {'notifications': , 'abort': , 'log': }

@xxyzz xxyzz reopened this Dec 29, 2022
@xxyzz
Copy link
Owner

xxyzz commented Dec 29, 2022

There should be another error message at the end of the log you posted before, could you copy and paste that?

@brock27625
Copy link
Author

Here's a freshie

calibre, version 6.10.0 (darwin, embedded-python: True)
Welcome to dependency hell: Please delete the '/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py*' folder then try again.

Starting job: Generating Word Wise and X-Ray for Death's End
Job: "Generating Word Wise and X-Ray for Death's End" 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 167, in do_job
run_subprocess(args, input_str)
File "calibre_plugins.worddumb.utils", line 59, in run_subprocess
return subprocess.run(
File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/opt/homebrew/bin/python3', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', 'B00WDVKZY0', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", "Death's_End", 'bc309994', 'en_core_web_md', 'en', 'en', 'utf-8', 'WordDumb/3.28.1 (https://github.com/xxyzz/WordDumb)', 'cn', '', 'AZW3', '1', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x', '-s']' returned non-zero exit status 1.

Called with args: ((114, 'AZW3', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", <calibre.ebooks.metadata.book.base.Metadata object at 0x114d7ffd0>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), True, True) {'notifications': <queue.Queue object at 0x114d7c8e0>, 'abort': <threading.Event object at 0x114d2afb0>, 'log': <calibre.utils.logging.GUILog object at 0x114d2aa10>}
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/main.py", line 56, in
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 225, in create_files
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 584, in load_spacy
File "/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py3.10/spacy/init.py", line 14, in
from . import pipeline # noqa: F401
File "/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py3.10/spacy/pipeline/init.py", line 2, in
from .dep_parser import DependencyParser
File "spacy/pipeline/dep_parser.pyx", line 1, in init spacy.pipeline.dep_parser
File "spacy/pipeline/transition_parser.pyx", line 1, in init spacy.pipeline.transition_parser
ModuleNotFoundError: No module named 'thinc.extra'

@xxyzz
Copy link
Owner

xxyzz commented Dec 29, 2022

Please run these commands then try again:

$ rm -rf /Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py*
$ /opt/homebrew/bin/python3 -m pip cache purge

@brock27625
Copy link
Author

Doesn't seem to have worked:

calibre, version 6.10.0 (darwin, embedded-python: True)
Welcome to dependency hell: Please delete the '/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py*' folder then try again.

Starting job: Generating Word Wise and X-Ray for Death's End
Job: "Generating Word Wise and X-Ray for Death's End" 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 167, in do_job
run_subprocess(args, input_str)
File "calibre_plugins.worddumb.utils", line 59, in run_subprocess
return subprocess.run(
File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/opt/homebrew/bin/python3', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', 'B00WDVKZY0', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", "Death's_End", 'bc309994', 'en_core_web_md', 'en', 'en', 'utf-8', 'WordDumb/3.28.1 (https://github.com/xxyzz/WordDumb)', 'cn', '', 'AZW3', '1', '/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x', '-s']' returned non-zero exit status 1.

Called with args: ((114, 'AZW3', "/Users/brockellett/Library/CloudStorage/GoogleDrive-brockellett@gmail.com/My Drive/File/Calibre Library/Cixin Liu/Death's End (114)/Death's End - Cixin Liu.azw3", <calibre.ebooks.metadata.book.base.Metadata object at 0x14fbcc490>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English', 'gloss': True, 'has_trf': True}), True, True) {'notifications': <queue.Queue object at 0x14fbcc280>, 'abort': <threading.Event object at 0x14fbccd60>, 'log': <calibre.utils.logging.GUILog object at 0x14fbcce20>}
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/main.py", line 56, in
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 225, in create_files
File "/Users/brockellett/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 584, in load_spacy
File "/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py3.10/spacy/init.py", line 14, in
from . import pipeline # noqa: F401
File "/Users/brockellett/Library/Preferences/calibre/plugins/worddumb-libs-py3.10/spacy/pipeline/init.py", line 2, in
from .dep_parser import DependencyParser
File "spacy/pipeline/dep_parser.pyx", line 1, in init spacy.pipeline.dep_parser
File "spacy/pipeline/transition_parser.pyx", line 1, in init spacy.pipeline.transition_parser
ModuleNotFoundError: No module named 'thinc.extra'

@xxyzz
Copy link
Owner

xxyzz commented Dec 30, 2022

What's the output of these commands?

$ python3 -m pip list --path ~/Library/Preferences/calibre/plugins/worddumb-libs-py3.10
$ ls -lhG Library/Preferences/calibre/plugins/worddumb-libs-py3.10/thinc
$ ls -lhG Library/Preferences/calibre/plugins/worddumb-libs-py3.10/thinc/extra

@brock27625
Copy link
Author

brockellett@Brocks-Air ~ % python3 -m pip list --path ~/Library/Preferences/calibre/plugins/worddumb-libs-py3.10
Package Version


blis 0.7.9
catalogue 2.0.8
certifi 2022.12.7
charset-normalizer 2.1.1
click 8.1.3
confection 0.0.3
cymem 2.0.7
en-core-web-md 3.4.1
idna 3.4
Jinja2 3.1.2
langcodes 3.3.0
lxml 4.9.2
MarkupSafe 2.1.1
murmurhash 1.0.9
numpy 1.24.1
packaging 22.0
pathy 0.10.1
preshed 3.0.8
pydantic 1.10.3
rapidfuzz 2.13.6
requests 2.28.1
setuptools 65.6.3
smart-open 6.3.0
spacy 3.4.4
spacy-legacy 3.0.11
spacy-loggers 1.0.4
srsly 2.4.5
thinc 9.0.0.dev1
thinc-apple-ops 0.1.3
tqdm 4.64.1
typer 0.7.0
typing_extensions 4.4.0
urllib3 1.26.13
wasabi 1.1.0
brockellett@Brocks-Air ~ %


brockellett@Brocks-Air ~ % ls -lhG Library/Preferences/calibre/plugins/worddumb-libs-py3.10/thinc
total 392
-rw-r--r-- 1 brockellett staff 0B 30 Dec 11:00 init.pxd
-rw-r--r-- 1 brockellett staff 214B 30 Dec 11:00 init.py
drwxr-xr-x 15 brockellett staff 480B 30 Dec 11:00 pycache
-rw-r--r-- 1 brockellett staff 46B 30 Dec 11:00 about.py
-rw-r--r-- 1 brockellett staff 5.6K 30 Dec 11:00 api.py
drwxr-xr-x 20 brockellett staff 640B 30 Dec 11:00 backends
-rw-r--r-- 1 brockellett staff 2.4K 30 Dec 11:00 compat.py
-rw-r--r-- 1 brockellett staff 1.3K 30 Dec 11:00 config.py
-rw-r--r-- 1 brockellett staff 3.7K 30 Dec 11:00 initializers.py
drwxr-xr-x 71 brockellett staff 2.2K 30 Dec 11:00 layers
drwxr-xr-x 5 brockellett staff 160B 30 Dec 11:00 legacy
-rw-r--r-- 1 brockellett staff 22K 30 Dec 11:00 loss.py
-rw-r--r-- 1 brockellett staff 34K 30 Dec 11:00 model.py
-rw-r--r-- 1 brockellett staff 11K 30 Dec 11:00 mypy.py
-rw-r--r-- 1 brockellett staff 14K 30 Dec 11:00 optimizers.py
-rw-r--r-- 1 brockellett staff 0B 30 Dec 11:00 py.typed
-rw-r--r-- 1 brockellett staff 6.8K 30 Dec 11:00 schedules.py
drwxr-xr-x 10 brockellett staff 320B 30 Dec 11:00 shims
drwxr-xr-x 24 brockellett staff 768B 30 Dec 11:00 tests
-rw-r--r-- 1 brockellett staff 47K 30 Dec 11:00 types.py
-rw-r--r-- 1 brockellett staff 20K 30 Dec 11:00 util.py


brockellett@Brocks-Air ~ % ls -lhG Library/Preferences/calibre/plugins/worddumb-libs-py3.10/thinc/extra
ls: Library/Preferences/calibre/plugins/worddumb-libs-py3.10/thinc/extra: No such file or directory

@xxyzz
Copy link
Owner

xxyzz commented Dec 30, 2022

5efeeea should fix this error. Please download the test plugin zip file(don't unzip it) from GitHub Actions Artifacts at here when the test jobs are finished.

And you also need to delete the worddumb-libs-py3.10 folder.

@brock27625
Copy link
Author

I'm sorry I don't understand what I need to do with 5efeeea or the artifacts link you sent through

@xxyzz
Copy link
Owner

xxyzz commented Dec 30, 2022

Please download and install this zip file created from GitHub Actions in calibre's plugins window by clicking the "load plugin from file" button.

@brock27625
Copy link
Author

Success! Thank you mate!

@xxyzz xxyzz closed this as completed Dec 30, 2022
@mgrimace
Copy link

mgrimace commented Jan 4, 2023

FYI I had similar errors, and had to add the steps brew update, brew upgrade and brew link --overwrite python@3.10 to the steps above. It looks like I hadn't upgraded python or homebrew in a while and the link/overwrite command tidied things up for me and resolved the errors.

@xxyzz
Copy link
Owner

xxyzz commented Jan 4, 2023

Some suggestions:

  • brew upgrade runs brew update by default. So you only need to run brew upgrade to upgrade all installed formulas.
  • You also don't need to run brew link. The latest Python binary(3.10 for now) is already linked to the command python3 when you install the python package with command brew install python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants