问题
i am a beginner in python and 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 when in run the command "from polyglot.detect import Detector" i am getting any error
Traceback (most recent call last): File "", line 1, in 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 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 from icu import Locale ImportError: No module named 'icu'
not sure what i need to be doing.
Can anyone please help?
回答1:
You need to install https://github.com/ovalhub/pyicu
pip install pyicu
回答2:
You need to install the libraries polyglot, PyICU and pycld2 with the commands:
pip install polyglot
pip install PyICU
pip install pycld2
来源:https://stackoverflow.com/questions/31682462/error-when-using-the-command-from-polyglot-detect-import-detector