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.

Community
  • 1
  • 1
A.J. Uppal
  • 19,117
  • 6
  • 45
  • 76

8 Answers8

10

Try this - It worked for me on Ubuntu.

sudo apt-get install libenchant1c2a
Dhiraj
  • 481
  • 6
  • 13
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.

Slater Victoroff
  • 21,376
  • 21
  • 85
  • 144
  • 1
    It still didn't work... the `brew` was successful, but the `pip install pyenchant` raised the same errors. – A.J. Uppal Jan 13 '14 at 03:14
  • 1
    @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 pyenchant` – Slater Victoroff Jan 13 '14 at 03:16
1

Try either sudo pip install or sudo easy install.

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.

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
Kelvin N.
  • 7
  • 7
0
sudo easy_install

sudo because MAC permissions are usually messed up

László Papp
  • 51,870
  • 39
  • 111
  • 135
0

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

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?

Community
  • 1
  • 1
Kelvin N.
  • 7
  • 7
0

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

Ruth
  • 1
  • 2