Cannot Start Leo When Enchant Speller Is Missing Libraries

56 views
Skip to first unread message

Thomas Passin

unread,
Jan 10, 2023, 10:53:40 PM1/10/23
to leo-editor
I created a new virtual machine for a Linux distro new to me - Manjaro.  Although pyenchant is installed, and the system's package manager claims that the Enchant libraries are installed, they aren't playing together.

I installed Leo but it won't start because pyenchant isn't working.  I don't think the error messages will be helpful, but here are the last few lines:

File "/home/tom/.local/lib/python3.10/site-packages/enchant/__init__.py", line 287, in _request_dict_data
    self._raise_error(e_str % (tag,), DictNotFoundError)

  File "/home/tom/.local/lib/python3.10/site-packages/enchant/__init__.py", line 233, in _raise_error
    raise eclass(default)

enchant.errors.DictNotFoundError: Dictionary for language 'en_US' could not be found
Please check https://pyenchant.github.io/pyenchant/ for details


I don't think that the problem is really that the en_US dictionary can't be found, because of other errors when I import pyenchant into a Python REPL session.  It imports but then can't actually run various functions.

I looked in the pyenchant web site, and found that it can be tricky to get the right version of the pyenchant working with the versions of the enchant binaries that  might have been compiled for your machine (especially on Windows, and yes, I know this case is Linux).

I can't find a setting to allow Leo to skip loading the spellchecker.  I have looked in LeoSettings.leo and myLeoSettings, and searched through pyLeoRef without hitting on one.  It seems to me that I remember such a setting, but I haven't been able to find it.

If there is not such a setting, I think there should be one.  It doesn't make sense for Leo to be unable to run because of a problem with the pyenchant system.

Does anyone have some insight here?

Thomas Passin

unread,
Jan 11, 2023, 12:18:20 AM1/11/23
to leo-editor
Of course, one solution is to uninstall pyenchant.  I did that and now Leo can run.  

lewis

unread,
Jan 11, 2023, 4:49:25 AM1/11/23
to leo-editor
In leosettings.leo under Spell checking there is a node:
@string enchant-language = en-US

Does that help?

Edward K. Ream

unread,
Jan 11, 2023, 5:12:44 AM1/11/23
to leo-e...@googlegroups.com
On Tue, Jan 10, 2023 at 9:53 PM Thomas Passin <tbp1...@gmail.com> wrote:

> I don't think the error messages will be helpful, but here are the last few lines:

In this case the full traceback would have been helpful.

In any case, I have just created #3043.

Edward

Thomas Passin

unread,
Jan 11, 2023, 8:46:59 AM1/11/23
to leo-editor
No, unfortunately it didn't.  There is something else wrong in the pyenchant package or the enchant support libraries (both of which which are installed by the distro's package manager).

Jacob Peck

unread,
Jan 11, 2023, 8:55:14 AM1/11/23
to leo-e...@googlegroups.com
Some packagers of PyEnchant do not include any dictionary files.  The PyEnchant documentation explains how to find one and install them: https://pyenchant.github.io/pyenchant/install.html#installing-a-dictionary

Try installing the package 'hunspell-en_US' (or the language of your choice).  That *should* do the trick to get this working on Manjaro, as it did on my Arch installs.

Jake

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/2cd290a1-fe2f-4e47-99e9-1830528b85f0n%40googlegroups.com.

Thomas Passin

unread,
Jan 11, 2023, 9:35:52 AM1/11/23
to leo-editor
Thanks for the tip.  I'll see if it works out.  Still, I think Leo should not fail to load if the spell checker is not functional, and it looks like there's now a PR about that.

Jacob Peck

unread,
Jan 11, 2023, 9:47:19 AM1/11/23
to leo-e...@googlegroups.com
Agreed, but this might be an issue in the PyEnchant library.  I suppose it can be coded around, though.

Edward K. Ream

unread,
Jan 11, 2023, 9:54:21 AM1/11/23
to leo-e...@googlegroups.com


On Wed, Jan 11, 2023 at 8:35 AM Thomas Passin <tbp1...@gmail.com> wrote:
...it looks like there's now a PR about that.

The PR has been merged into devel. Did the PR help?

Edward

Thomas Passin

unread,
Jan 11, 2023, 10:22:23 AM1/11/23
to leo-editor
Don't know yet. I don't have a git clone on the VM in question, I just spun it up and it needs some more provisioning.  

Thomas Passin

unread,
Jan 11, 2023, 1:57:33 PM1/11/23
to leo-editor
Yes, the PR did its job and Leo can start.  And I finally solved the problem of the missing en_US dictionary.  It turns out that on Manjaro, you have to open the Settings applet, then the Manjaro Settings Manager, then double-click on Language Packages, and then finally you can install the dictionary.  After all that, Leo's spell checker is working.

Edward K. Ream

unread,
Jan 11, 2023, 4:17:46 PM1/11/23
to leo-e...@googlegroups.com
On Wed, Jan 11, 2023 at 12:57 PM Thomas Passin <tbp1...@gmail.com> wrote:
Yes, the PR did its job and Leo can start.  And I finally solved the problem of the missing en_US dictionary. 

Thanks for the update. Glad to hear all is well.

Edward
Reply all
Reply to author
Forward
0 new messages