Error when using the command "from polyglot.detect import Detector"
Asked Answered
L

2

14

I was playing with the polyglot function to convert the text from one language to another like Spanish to English.

I was following the instructions to install the Polyglot and the required modules.

But while running the code

from polyglot.detect import Detector

I am getting this error:

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'

I'm not sure what I need to be doing.

Can anyone please help?

Lovesick answered 28/7, 2015 at 16:46 Comment(1)
B
15

You need to install the libraries polyglot, PyICU and pycld2 with the commands:

pip install polyglot
pip install PyICU
pip install pycld2
Barcelona answered 23/5, 2019 at 14:11 Comment(1)
Another package that should be installed is pip install morfessorDharna
K
8

You need to install https://github.com/ovalhub/pyicu

pip install pyicu
Karykaryl answered 24/8, 2015 at 23:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.