【问题标题】:Difficulty installing PyEnchant module on a Mac using Python 2.7使用 Python 2.7 在 Mac 上安装 PyEnchant 模块很困难
【发布时间】:2012-06-14 11:10:20
【问题描述】:

我无法在我的 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

我已尝试运行 pyenchant 网站上提供的 .dmg 文件。安装过程继续进行,没有任何错误消息,但是一旦完成,我仍然无法将 pyenchant 导入 Python,也无法在 Finder 中的任何位置找到已安装的软件。

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

您可能会说我不是经验丰富的 Python 用户,因此非常感谢您提供任何帮助。

【问题讨论】:

标签: python import installation python-module pyenchant


【解决方案1】:

安装附魔首先对我有用

brew install enchant

【讨论】:

    【解决方案2】:

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

    sudo port install py27-enchant

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

    port search aspell-dict
    

    例如,安装德语词典

    sudo port install aspell-dict-de
    

    你就完成了!

    (我希望你现在已经在别处找到了答案)

    【讨论】:

      【解决方案3】:

      试试这个 - 它在 Ubuntu 上对我有用。

       sudo apt-get install libenchant1c2a
      

      【讨论】:

        猜你喜欢
        • 2020-01-23
        • 1970-01-01
        • 2012-06-29
        • 1970-01-01
        • 2013-11-07
        • 1970-01-01
        • 2012-12-08
        • 2021-06-11
        • 1970-01-01
        相关资源
        最近更新 更多