Error when using the command “from polyglot.detect import Detector”

泄露秘密 提交于 2020-12-30 06:16:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!