I want to import enchant, but I get this error
Python 3.9.7 (default, Sep 16 2021, 08:50:36)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import enchant
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/site-packages/enchant/__init__.py", line 81, in <module>
from enchant import _enchant as _e
File "/opt/anaconda3/lib/python3.9/site-packages/enchant/_enchant.py", line 157, in <module>
raise ImportError(msg)
ImportError: The 'enchant' C library was not found and maybe needs to be installed.
See https://pyenchant.github.io/pyenchant/install.html
for details
I used these commands
brew install enchant
pip install pyenchant
pip install enchant
You can set the
PYENCHANT_LIBRARY_PATHenvironment variable to point to the library installed by Homebrew, like this:Now the import works: