pythonwindowsinstallationpolyglotuci

i had issue with installing "icu" in python 3.5 windows 10


error in instalation of UCI package in python

ERROR: Command "python setup.py egg_info" failed with error code 1

i already try

pip install uci4c
pip install uci
pip3 install uci

ImportError                               Traceback (most recent call last)
<ipython-input-5-47b8d2b39557> in <module>()
----> 1 from polyglot.downloader import downloader

c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\downloader.py in <module>()
     89 
     90 from polyglot import polyglot_path
---> 91 from polyglot.detect.langids import isoLangs
     92 from polyglot.utils import pretty_list
     93 from icu import Locale

c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\detect\__init__.py in <module>()
----> 1 from .base import Detector, Language
      2 
      3 __all__ = ['Detector', 'Language']

c:\users\sarir\appdata\local\programs\python\python35\lib\site-packages\polyglot\detect\base.py in <module>()
      9 
     10 
---> 11 from icu import Locale
     12 import pycld2 as cld2
     13 

ImportError: No module named 'icu'

Solution

  • I think you are trying to install polyglot and you are having that problem, if you just want to install PyICU you don't need to install the PyCLD2.whl, but all the other instructions are the same:

    To install polyglot in Windows using a Python 3.6 or Python 3.7 you will need a wheel for two dependencies:

    You need to download them and then install them with pip from your local machine.

    Here you will found many unofficial python builds: https://www.lfd.uci.edu/~gohlke/pythonlibs/

    install PyICU.whl
    install PyCLD2.whl
    

    (Do Ctrl+F "pyicu" and "pycld" because otherwise, it's difficult to navigate this website)

    In both cases, you will need to be able to choose the right version of the build for your Windows version and your python version.

    It's easy, for example for PyICU:

    PyICU wraps the ICU (International Components for Unicode) library.
    
    PyICU‑2.3.1‑cp27‑cp27m‑win32.whl
    PyICU‑2.3.1‑cp27‑cp27m‑win_amd64.whl
    PyICU‑2.3.1‑cp35‑cp35m‑win32.whl
    PyICU‑2.3.1‑cp35‑cp35m‑win_amd64.whl
    PyICU‑2.3.1‑cp36‑cp36m‑win32.whl
    PyICU‑2.3.1‑cp36‑cp36m‑win_amd64.whl
    PyICU‑2.3.1‑cp37‑cp37m‑win32.whl
    PyICU‑2.3.1‑cp37‑cp37m‑win_amd64.whl
    

    the 27 means Python 2.7 and the 36 Python 3.6... If you have 64 bits python and windows then choose the amd64 otherwise the win32 version.

    Once you have download them you will need to install it using pip in your python environment:

    In my case:

    python -m pip install C:\Users\Administrator\Downloads\pycld2-0.31-cp37-cp37m-win_amd64.whl 
    python -m pip install C:\Users\Administrator\Downloads\PyICU-2.3.1-cp37-cp37m-win_amd64.whl