0

I need installing pyenchant v1.6.7 on MacBook with Apple Silicon (M1 Pro) for Python 2.7.18.

This package is a wrapper for C-library enchant, so it requires to the enchant was installed firstly. Well, I've installed the enchant by: brew install enchant.

However, when I try to install pyenchant using PIP I got the next error:

         cwd: /private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/setup.py", line 210, in <module>
        import enchant
      File "enchant/__init__.py", line 92, in <module>
        from enchant import _enchant as _e
      File "enchant/_enchant.py", line 145, in <module>
        raise ImportError(msg)
    ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Also I have tried to specify LDFLAGS and CFLAGS:

LDFLAGS='-L/opt/homebrew/Cellar/enchant/2.3.3/lib' CFLAGS="-I/opt/homebrew/Cellar/enchant/2.3.3/include" ~/.pyenv/versions/2.7.18/bin/pip install --no-cache-dir pyenchant==1.6.7

But it doesn't work, I still get the same error.

How to specify the enchant library for the pyenchant module?

Denis Sologub
  • 7,277
  • 11
  • 56
  • 123

0 Answers0