【问题标题】:Error when using the command "from polyglot.detect import Detector"使用命令“from polyglot.detect import Detector”时出错
【发布时间】:2015-10-19 08:56:04
【问题描述】:

我正在使用多语言功能将文本从一种语言转换为另一种语言,例如将西班牙语转换为英语。

我按照说明安装了 Polyglot 和所需的模块。

但是在运行代码时

from polyglot.detect import Detector

我收到此错误:

Traceback (most recent call last):   
  File "<pyshell#8>", line 1, in <module>
    from polyglot.detect import Detector   
  File "C:\Python34\lib\site-packages\polyglot-15.5.2-py3.4.egg\polyglot\detect\__init__.py", line 1, in <module>
    from .base import Detector, Language   
  File "C:\Python34\lib\site-packages\polyglot-15.5.2-py3.4.egg\polyglot\detect\base.py", line 11, in <module>
    from icu import Locale ImportError: No module named 'icu'

我不确定我需要做什么。

有人可以帮忙吗?

【问题讨论】:

标签: python polyglot


【解决方案1】:

您需要使用以下命令安装库 polyglot、PyICU 和 pycld2:

pip install polyglot
pip install PyICU
pip install pycld2

【讨论】:

  • 另一个应该安装的包是pip install morfessor
【解决方案2】:

你需要安装https://github.com/ovalhub/pyicu

pip install pyicu

【讨论】:

    猜你喜欢
    • 2022-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-15
    • 1970-01-01
    • 1970-01-01
    • 2014-06-16
    相关资源
    最近更新 更多