Difficulty installing PyEnchant module on Mac using Python 2.7

I'm having trouble getting a Python module called PyEnchant on my Mac. I am using Python 2.7. When I open and run setup.py pyenchant 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 tried to run the .dmg file available on the pyenchant website. The installation processes proceed without error messages, but as soon as they are completed, I still cannot import pyenchant into Python and cannot find the installed software anywhere in the Finder.

I also tried using the .egg installer, which opened a Python window with the letters "PK" written at the top in the black capitals. I do not know what it means.

As you can probably say that I'm not an experienced Python user, so any help on this is greatly appreciated.

+6
source share
3 answers

The enchantment installation first worked for me

 brew install enchant 
+4
source

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

sudo port install py27-enchant

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

 port search aspell-dict 

for example, installing a German dictionary

 sudo port install aspell-dict-de 

And you're done!

(hope you found your answer elsewhere though)

0
source

Try this - it worked for me on Ubuntu.

  sudo apt-get install libenchant1c2a 
0
source

Source: https://habr.com/ru/post/917800/


All Articles