12

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?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Rajni
  • 121
  • 1
  • 1
  • 6

2 Answers2

15

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

pip install polyglot
pip install PyICU
pip install pycld2
double-beep
  • 5,031
  • 17
  • 33
  • 41
Priyansh gupta
  • 906
  • 12
  • 10
8

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

pip install pyicu
Vic Nicethemer
  • 1,081
  • 3
  • 16
  • 38