使用Python 2.7在Mac上安装PyEnchant模块有困难

使用Python 2.7在Mac上安装PyEnchant模块有困难,python,import,installation,python-module,pyenchant,Python,Import,Installation,Python Module,Pyenchant,我很难在Mac上安装一个名为PyEnchant的Python模块。我正在使用Python 2.7。打开并运行pyenchant setup.py文件时,会收到以下错误消息: Traceback (most recent call last): File "/Applications/Python 2.7/pyenchant-1.6.5/setup.py", line 195, in <module> import enchant File "/Applications/Py

我很难在Mac上安装一个名为PyEnchant的Python模块。我正在使用Python 2.7。打开并运行pyenchant setup.py文件时,会收到以下错误消息:

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
回溯(最近一次呼叫最后一次):
文件“/Applications/Python 2.7/pyenchant-1.6.5/setup.py”,第195行,在
进口附魔
文件“/Applications/Python 2.7/pyenchant-1.6.5/enchant/_init__.py”,第90行,在
从“enchant import”\u enchant as\u e
文件“/Applications/Python 2.7/pyenchant-1.6.5/enchant/_enchant.py”,第133行,在
引发导入错误(“未找到enchant C库”)
ImportError:未找到enchant C库
我已尝试运行pyenchant网站上提供的.dmg文件。安装过程继续进行,没有任何错误消息,但一旦完成,我仍然无法将pyenchant导入Python,也无法在Finder中的任何位置找到已安装的软件

我还尝试使用.egg安装程序,它打开了一个Python窗口,顶部用黑色大写字母写着“PK”。我不知道这是什么意思


正如您可能知道的,我不是一个有经验的Python用户,因此非常感谢您在这方面提供的任何帮助。

安装PyEnchant的方法有很多,例如使用MacPorts:

sudo端口安装py27 enchant

这将另外安装enchant、aspell和hunspell库。您必须单独安装字典,才能运行字典列表

port search aspell-dict
例如,安装德语词典

sudo port install aspell-dict-de
你完了


(我希望您现在已经在其他地方找到了答案)

安装enchant首先对我有效

brew install enchant

试试这个-它在Ubuntu上对我有效

 sudo apt-get install libenchant1c2a

我可以安装,但我不能让它在jupyter笔记本上工作。。。