Error installing polyglot in python 3.5.2

情到浓时终转凉″ 提交于 2019-12-12 01:46:18

问题


I want to do sentiment analysis on urdu sentences. I searched a python package Polyglot having URDU POS tagger in it. But on installing, it prompts error;

Any way out?


回答1:


Even I struggled with this error for a long time.

Follow these steps to install polyglot on Windows:

  1. download package from [https://pypi.python.org/pypi/polyglot][1] . extract into folder
  2. download and install these whl files : pycld2-0.31-cp36-cp36m-win_amd64.whl, PyICU-1.9.8-cp36-cp36m-win_amd64.whl. (Also numpy - I didn't need this since I already had it installed)
  3. Open setup.py in notepad and make the following changes: (need to install codecs for this)

The README.rst file throws codecs error. Replace the 2 lines with the following:

import codecs
with codecs.open('README.rst', 'r', encoding='utf-8') as readme_file:
    readme = readme_file.read()
  1. install using 'python setup.py install'

I just made sure that the 'utf-8' UnicodeDecodeError is handled while reading file.

Hope this helps!!!




回答2:


You need to install PyICU before running pip install polyglot.

You can follow PyICU Installation for Windows from https://pypi.org/project/PyICU/



来源:https://stackoverflow.com/questions/41746072/error-installing-polyglot-in-python-3-5-2

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