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

8

11

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.

Economize answered 13/1, 2014 at 2:40 Comment(0)
W
8

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.

Wivinah answered 13/1, 2014 at 2:56 Comment(2)
It still didn't work... the brew was successful, but the pip install pyenchant raised the same errors.Economize
@aj8uppal sounds like you've got some permissions messed up (pretty common on mac). I would suggest trying both with and without sudo for both of the commands: brew install enchant, and pip install pyenchantWivinah
P
10

Try this - It worked for me on Ubuntu.

sudo apt-get install libenchant1c2a
Prom answered 7/1, 2015 at 11:23 Comment(1)
Although the question was about OSX, this helped me with a docker build. tnx.Beauharnais
W
8

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.

Wivinah answered 13/1, 2014 at 2:56 Comment(2)
It still didn't work... the brew was successful, but the pip install pyenchant raised the same errors.Economize
@aj8uppal sounds like you've got some permissions messed up (pretty common on mac). I would suggest trying both with and without sudo for both of the commands: brew install enchant, and pip install pyenchantWivinah
C
1

Try either sudo pip install or sudo easy install.

Commissionaire answered 27/4, 2014 at 18:1 Comment(0)
F
1

[nltk_data] Error loading enchant: Package 'enchant' not found in

No. if you get this problem, you are supposed to install it like this:

$ sudo easy_install pyenchant

it is not an nltk package, it is a package on its own.

Freeforall answered 2/3, 2015 at 12:18 Comment(0)
C
0
sudo easy_install

sudo because MAC permissions are usually messed up

Cerise answered 4/2, 2014 at 5:1 Comment(0)
N
0

Try a pip install, an easy_install, and a brew.

Nutty answered 3/3, 2014 at 3:36 Comment(0)
F
0

You have to download the NLTK package. That is how you get Pyenchant running. But if your building a grammar checker, pyenchant is not advisable because it only grammar checks two words. You should consider building a grammar checker on your own by starting with an autocomplete word completion from here: How to code autocompletion in python?

Freeforall answered 13/11, 2015 at 21:14 Comment(0)
F
0

For windows: download the required .exe file based on version from https://pypi.python.org/simple/pyenchant/ and pip install pyenchant

Ferrule answered 6/10, 2017 at 11:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.