【问题标题】:Error in Installing PyEnchant package on Windows-7 (64bit) for spelling check在 Windows-7(64 位)上安装 PyEnchant 包以进行拼写检查时出错
【发布时间】:2016-04-12 11:46:38
【问题描述】:

我使用的是 Windows-7、64 位 PC。我想使用 python 对文本执行拼写检查。我尝试使用“pip install pyenchant”命令安装 PyEnchant 包。它被安装。但是当我尝试在 ipython 控制台中导入附魔时,它给出的错误是“ImportError:无法导入名称工具”。 有没有其他方法可以安装和使用 PyEnchant?

In [43]: import enchant
Traceback (most recent call last):
File "<ipython-input-43-be94a407aebb>", line 1, in <module>
import enchant
File "C:\Anaconda2\lib\site-packages\enchant\__init__.py", line 92, in <module>
from enchant import _enchant as _e

File "C:\Anaconda2\lib\site-packages\enchant\_enchant.py", line 55, in <module>
from enchant import utils

ImportError: cannot import name utils

【问题讨论】:

    标签: python-2.7 importerror pyenchant


    【解决方案1】:

    在我看来,您还没有安装底层 C 库 Enchant。 Pyenchant 只是 Enchant C 库的一个 python 包装器。您可以自己构建和安装 C 库,从 http://www.abisource.com/projects/enchant/#download 获取代码,或者当您询问是否有其他安装方法时,使用 http://pythonhosted.org/pyenchant/download.html 上的 pyenchant-1.6.6.win32.exe 链接安装 Enchant为您提供的 C 库。

    【讨论】:

    • 感谢您的回答!但我认为由于我的 PC 中的 Anaconda 版本是 64 位,因此 pyenchant-1.6.6.win32.exe 没有安装。那么我应该使用 32 位 Anaconda 包吗?
    • 如果 .exe 没有安装,我会从源代码编译它。
    猜你喜欢
    • 2016-10-12
    • 2012-10-11
    • 2015-03-30
    • 1970-01-01
    • 1970-01-01
    • 2011-01-26
    • 2017-09-04
    • 2016-07-06
    • 2015-06-26
    相关资源
    最近更新 更多