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 can't find Python (installed via Homebrew), even after specifying explicitly the path to it via macos-env.txt #137

Closed arooni closed 1 year ago

arooni commented 1 year ago
Job: "Generating Word Wise and X-Ray for Meditations" 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 154, in do_job
    install_deps("lxml", notifications)
  File "calibre_plugins.worddumb.deps", line 36, in install_deps
    PY_PATH, py_version = which_python()
  File "calibre_plugins.worddumb.deps", line 84, in which_python
    raise Exception("PythonNotFound")
Exception: PythonNotFound

Called with args: ((411, 'EPUB', '/Users/david/syncthing/ebooks/calibre library/Marcus Aurelius (Emperor of Rome)/Meditations (411)/Meditations - Marcus Aurelius (Emperor of Rome).epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x116ee72e0>, 'en'), True, True) {'notifications': <queue.Queue object at 0x116ee6440>, 'abort': <threading.Event object at 0x116ee7df0>, 'log': <calibre.utils.logging.GUILog object at 0x116ee60b0>} 

Despite this being in [~/Library/Preferences/calibre/macos-env.txt:

PATH=/opt/homebrew/opt/python@3.11/libexec/bin:$PATH
[I]  /   master   which python
/usr/local/opt/python@3.11/libexec/bin/python
xxyzz commented 1 year ago

You don't have to add PATH to macos-env.txt if the package is installed from homebrew, and please also make sure both python and calibre are not using Rosetta.

arooni commented 1 year ago

Thanks for the fast response time !

M1 mac would mean no Rosetta correct ?

And I tried to add it to that file but the only way I could make your plugin work was launch it from the command line in fish where the path is set to see python.

On Fri, Jul 21, 2023, 9:19 PM xxyzz @.***> wrote:

You don't have to add PATH to macos-env.txt if the package is installed from homebrew, and please also make sure both python and calibre are not using Rosetta.

— Reply to this email directly, view it on GitHub https://github.com/xxyzz/WordDumb/issues/137#issuecomment-1646386405, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEH467DVATFFOW7IUOPANTXRM2BPANCNFSM6AAAAAA2TPSF4M . You are receiving this because you authored the thread.Message ID: @.***>

arooni commented 1 year ago

I did install python from homebrew.

On Fri, Jul 21, 2023, 9:34 PM David Parkinson @.***> wrote:

Thanks for the fast response time !

M1 mac would mean no Rosetta correct ?

And I tried to add it to that file but the only way I could make your plugin work was launch it from the command line in fish where the path is set to see python.

On Fri, Jul 21, 2023, 9:19 PM xxyzz @.***> wrote:

You don't have to add PATH to macos-env.txt if the package is installed from homebrew, and please also make sure both python and calibre are not using Rosetta.

— Reply to this email directly, view it on GitHub https://github.com/xxyzz/WordDumb/issues/137#issuecomment-1646386405, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEH467DVATFFOW7IUOPANTXRM2BPANCNFSM6AAAAAA2TPSF4M . You are receiving this because you authored the thread.Message ID: @.***>

xxyzz commented 1 year ago

Please read this document(https://support.apple.com/en-us/HT211861) to check if calibre(or your terminal) is using Rosetta.

And homebrew will link python to the correct location(/usr/local/bin or /opt/homebrew/bin) so users shouldn't add the path manually. Could you check whether /opt/homebrew/bin/python3 exists?

And also the macos-env.txt file feature is not included in the v3.29.3 release. You can download the master branch test version from GitHub Actions Artifacts.