6

I'm having trouble getting a Python module called PyEnchant to install on my Mac. I am using Python 2.7. When I open up and run the pyenchant setup.py file I get the following error message:

Traceback (most recent call last):
File "/Applications/Python 2.7/pyenchant-1.6.5/setup.py", line 195, in <module>
    import enchant

File "/Applications/Python 2.7/pyenchant-1.6.5/enchant/__init__.py", line 90, in <module>
    from enchant import _enchant as _e

File "/Applications/Python 2.7/pyenchant-1.6.5/enchant/_enchant.py", line 133, in <module>
    raise ImportError("enchant C library not found")

ImportError: enchant C library not found

I have tried running the .dmg file that is available on the pyenchant website. The installation processes proceeds without any error messages but, once it completes, I am still unable to import pyenchant into Python, nor can I find the installed software anywhere in Finder.

I also tried to use the .egg installer, which opened up a Python window with the letters "PK" written at the top in black capitals. I don't know what this means.

As you can probably tell I am not an experienced Python user so any help on this is greatly appreciated.

Kijewski
  • 25,517
  • 12
  • 101
  • 143
Matt Robinson
  • 305
  • 1
  • 4
  • 14
  • I was able to install, but I can't get it to work on a jupyter notebook...https://stackoverflow.com/questions/44170766/cant-import-enchant-using-a-jupyter-notebook – Monica Heddneck May 25 '17 at 01:13

3 Answers3

4

Installing enchant first worked for me

brew install enchant
kcathode
  • 41
  • 2
0

There are many ways to install PyEnchant, for example with MacPorts:

sudo port install py27-enchant

This will additionally install enchant, aspell, and hunspell libraries. You have to install dictionaries separately, to get a list of them run

port search aspell-dict

for example, installing the German dictionary

sudo port install aspell-dict-de

And you're done!

(I hope you have found your answer elsewhere by now though)

margold
  • 587
  • 2
  • 5
  • 16
0

Try this - It worked for me on Ubuntu.

 sudo apt-get install libenchant1c2a
Dhiraj
  • 481
  • 6
  • 13