Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"enchant C library not found" while installing pyenchant using pip on OSX

I typed in pip install pyenchant into my shell, but it raised two Traceback errors:

1:

Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant/setup.py", line 195, in <module>
    import enchant
  File "enchant/__init__.py", line 90, in <module>
    from enchant import _enchant as _e
  File "enchant/_enchant.py", line 133, in <module>
    raise ImportError("enchant C library not found")
ImportError: enchant C library not found

2:

Traceback (most recent call last):

    File "<string>", line 16, in <module>

    File "/private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant/setup.py", line 195, in <module>

        import enchant

    File "enchant/__init__.py", line 90, in <module>

        from enchant import _enchant as _e

     File "enchant/_enchant.py", line 133, in <module>

        raise ImportError("enchant C library not found")

ImportError: enchant C library not found

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant

I have python 2.7 default installed on my mac, but it still isn't working. I have already looked at Unable to install pyenchant-1.6.5 for python 2.7 on Mac OSX Lion but it doesn't answer my question, as easy_install pyenchant raises even more errors.

like image 980
A.J. Uppal Avatar asked Jan 13 '14 02:01

A.J. Uppal


People also ask

How do I install an enchantment library in Python?

To install Enchant module, we can use the following command: ! pip3 install pyenchant.


2 Answers

Try this - It worked for me on Ubuntu.

sudo apt-get install libenchant1c2a
like image 185
Dhiraj Avatar answered Sep 19 '22 17:09

Dhiraj


You need to install enchant, which is a C library. You can use Homebrew, to do this kind of package management. Just enter:

brew install enchant

Before trying to pip install pyenchant and you should be fine.

like image 28
Slater Victoroff Avatar answered Sep 20 '22 17:09

Slater Victoroff