aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

Ubuntu installation problem #244

Open DuyguA opened 3 years ago

DuyguA commented 3 years ago

I installed pyicu via pip , but I still have the following problem:

from icu import Locale
ImportError: cannot import name 'Locale' from 'icu' (/usr/local/lib/python3.8/dist-packages/icu/__init__.py)

icu looks installed correctly, but there's no Locale:

>>> import icu
>>> dir(icu)
['ExternalEventSink', 'ExternalEventSource', 'NAME', 'Pipe', 'SimpleNamespace', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'atexit', 'component', 'config', 'configuration', 'constants', 'copy', 'cycle', 'event', 'eyetracking', 'fuel_monitor', 'generator', 'get_event_sinks', 'get_event_sources', 'get_external_event_sinks', 'get_external_event_sources', 'highlight', 'keyhandler', 'log', 'main_panel', 'os', 'overlay', 'panel', 'pprint', 'process', 'random', 'run', 'start', 'system_monitor', 'task_fuel_monitor', 'task_system_monitor', 'task_tracking', 'tk', 'traceback', 'tracking']

Any help is appreciated, thanks in advance!

g8a9 commented 3 years ago

Up. I am having the same installation issue on Ubuntu 20.04.

Edit: I solved the issue by manually updating pyicu, pycld2, and morfessor to the latest versions. I think that the package does not install all the dependencies correctly (I can't see anything relevant in the setup.py)

DuyguA commented 3 years ago

@g8a9 many thanks for the tip! I installed via pip, I don't know if they're the latest versions. Would you mind telling the version numbers of pyicu , pycld2 and morfessor ?