Git Product home page Git Product logo

Comments (38)

aboSamoor avatar aboSamoor commented on June 5, 2024 76

Please follow the installation instrcutions mentioned in the documentation

http://polyglot.readthedocs.org/en/latest/Installation.html

from polyglot.

mwozniczak avatar mwozniczak commented on June 5, 2024 67

@lukaskawerau try pip install pyicu

from polyglot.

olmerg avatar olmerg commented on June 5, 2024 62

for me work
pip3 install pyicu
pip3 install pycld2

from polyglot.

davidvartanian avatar davidvartanian commented on June 5, 2024 40

Fiedzia is right. The error refers to a Python module, but libicu-dev is a Linux dependency (you need both).
I've got rid of this error installing the package python3-icu.
Then another dependency error ocurred:
ImportError: No module named 'pycld2' (yes, I'd followed the installation instructions too).
Then I installed pycld2 with pip3 and everything went well.

from polyglot.

13muskanp avatar 13muskanp commented on June 5, 2024 27

pip3 install -U git+https://github.com/aboSamoor/polyglot.git@master
This one worked out well for me
No need to downgrade or anything.

from polyglot.

agn-7 avatar agn-7 commented on June 5, 2024 9

In my case, the following packages were needed:

pip install pyicu 
pip install pycld2
pip install morfessor

from polyglot.

sjlongland avatar sjlongland commented on June 5, 2024 8

@aboSamoor I have icu installed (Gentoo system; so libraries and headers) and struck the same issue as others. It appears icu (aka libicu on Debian) is not the package that provides the icu module in Python; pyicu is.

emerge dev-python/pyicu followed by pip3 install --user pycld2 morfessor (since the latter two aren't in Gentoo repositories), cured the issue for me. I think pyicu would be worth mentioning in your documents, as it seems it, not icu itself, is the direct dependency.

Directing people at a document that clearly references the wrong dependency does not help. :-)

from polyglot.

donglixp avatar donglixp commented on June 5, 2024 6
conda install -c conda-forge pyicu 

from polyglot.

Mika15 avatar Mika15 commented on June 5, 2024 5

Guys, I got the same issue. I found this great article and the problem was resolved: https://tobywf.com/2017/05/installing-pyicu-on-macos/

from polyglot.

npow avatar npow commented on June 5, 2024 3

I got it to work on anaconda with conda install -c conda-forge pyicu

from polyglot.

jonathan-kosgei avatar jonathan-kosgei commented on June 5, 2024 3

I had to do the following to get it to work;

python3.7 -m pip install polyglot
sudo apt-get install python3.7-numpy libicu-dev
sudo apt-get install python3.7-icu
python3.7 -m pip install morfessor

from polyglot.

peide avatar peide commented on June 5, 2024 2

Anaconda default icu's version is 54. There are problems when building pyicu with these libraries.
Update ICU to version 58:
conda install -c conda-forge icu=58.1

from polyglot.

lukaskawerau avatar lukaskawerau commented on June 5, 2024 2

Is this getting fixed? I'm trying to use polyglot with Anaconda and Python 3.5 and get the same error as above. The suggestions for installing python3-icu, pycld2 and icu=58.1 do not resolve the problem.

from polyglot.

simonfullernuim avatar simonfullernuim commented on June 5, 2024 2

Hi, on py2.7.12 ubuntu 16.04 I get the following error from polyglot.detect import Detector:
ImportError: libicule.so.54: cannot open shared object file: No such file or directory
I have already tried conda install -c conda-forge icu=58.1 and reinstalling but this does not help.
Do you have any suggestions to solve this particular problem?
Otherwise could you suggest another workaround to get the language detector functionality?
Thanks!

from polyglot.

eduamf avatar eduamf commented on June 5, 2024 2
sudo apt-get install build-essential
pip install PyICU

Now, it's OK

from polyglot.

rbkahn avatar rbkahn commented on June 5, 2024 2

conda install -c conda-forge pyicu was the thing I needed to get past the icu step.

from polyglot.

aakashkag avatar aakashkag commented on June 5, 2024 2

@13muskanp your solution worked without facing any further issue. saved my day. thank you.

from polyglot.

Atul-Anand-Jha avatar Atul-Anand-Jha commented on June 5, 2024 2

Hello!

I stil get the same error

ImportError: cannot import name 'Locale' from 'icu'

I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev

try the above hack which i have mentioned. that worked for me on several virtual envs.

from polyglot.

Infovarius avatar Infovarius commented on June 5, 2024 1

Please follow the installation instrcutions mentioned in the documentation

http://polyglot.readthedocs.org/en/latest/Installation.html

It doesn't help. ICU can't be installed: KeyError: 'ICU_VERSION'

from polyglot.

Chromanon avatar Chromanon commented on June 5, 2024 1

I had to do the following to get it to work;

python3.7 -m pip install polyglot
sudo apt-get install python3.7-numpy libicu-dev
sudo apt-get install python3.7-icu
python3.7 -m pip install morfessor

Thank you! it has worked for me

from polyglot.

j127 avatar j127 commented on June 5, 2024 1

In case this can help anyone avoid a few hours of frustration, I wrote a quick tutorial on how I got it running in Docker.

from polyglot.

0x4f53 avatar 0x4f53 commented on June 5, 2024 1

Hello!

I stil get the same error

ImportError: cannot import name 'Locale' from 'icu'

I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev

Make sure PyICU is installed in the correct location. I accidentally installed it via sudo and it took me a lot of time to fix.

First, remove any traces of ICU with sudo pip uninstall pyicu and pip uninstall pyicu
If you want to download whatever's latest, clear pip's cache via pip cache purge
Then reinstall it with pip install pyicu.

from polyglot.

davidvartanian avatar davidvartanian commented on June 5, 2024

pyICU can be quite tricky because it should be installed to use a particular version of ICU, and this depends on each operating system. Incompatibility problems like the famous "undefined symbol" are, as I understand, related to the difference of versions between the operating system and the python library.
In addition, Anaconda makes things easier but there's an exception with these libraries.
This is my comment about Anaconda's installation but actually the same thing: #78 (comment)

from polyglot.

tigerninjaman avatar tigerninjaman commented on June 5, 2024

What worked for me was downloading the polyglot master file as well as the correct pycld2 and pyicu .whl files from https://www.lfd.uci.edu/~gohlke/pythonlibs/, then doing pip install pycld2-0. ... .whl and pip install pyicu- ... .whl, then navigating inside polyglot-master and doing python setup.py install.

from polyglot.

suhailgupta03 avatar suhailgupta03 commented on June 5, 2024

@lukaskawerau try pip install pyicu

It is still not working for me. pip install pyicu only works with sudo and I have installed everything but still see this error.

from polyglot.

christofs avatar christofs commented on June 5, 2024

Installing pyicu also worked for me. It would have helped a lot if the dependency mentioned in the error message would have been pyicu rather than just icu. (Also, this dependency should of course have been installed when I installed polyglot in the first place.)

from polyglot.

josircg avatar josircg commented on June 5, 2024

If you are running on Debian/Ubuntu and using python3, try:

pip install PyICU

from polyglot.

Infovarius avatar Infovarius commented on June 5, 2024

If you are running on Debian/Ubuntu and using python3, try:

pip install PyICU

RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.

from polyglot.

ojomio avatar ojomio commented on June 5, 2024

Why won't anyone add it to the requirements?

from polyglot.

yecphaha avatar yecphaha commented on June 5, 2024

在linux环境安装polyglot:

  1. 更新setuptools:pip3 install -U setuptools
  2. 安装polyglot:pip3 install polyglot -i https://mirrors.aliyun.com/pypi/simple
  3. 安装libicu-dev:sudo apt-get install python-numpy libicu-dev
  4. 安装pyicu:pip3 install pyicu -i https://mirrors.aliyun.com/pypi/simple
  5. 安装pycld2:pip3 install pycld2 -i https://mirrors.aliyun.com/pypi/simple
  6. 安装morfessor:pip3 install morfessor -i https://mirrors.aliyun.com/pypi/simple

from polyglot.

Atul-Anand-Jha avatar Atul-Anand-Jha commented on June 5, 2024

There's a simple hack to tackle this problem. -> Downgrade your pyicu version.
pyicu V2.3.1 worked for me, and i believe it will also work for most of you.

try this:

pip install polyglot

sudo apt-get install python-numpy libicu-dev

pip install pyicu==2.3.1

pip install morfessor

It definitely worked for me.

from polyglot.

renorosgon avatar renorosgon commented on June 5, 2024

Hello!

I stil get the same error

ImportError: cannot import name 'Locale' from 'icu'

I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev

from polyglot.

aalok-sathe avatar aalok-sathe commented on June 5, 2024

Hello!
I stil get the same error
ImportError: cannot import name 'Locale' from 'icu'
I'm on Linux Manjaro so I wanted to know the equivalent for libicu-dev

@renorosgon
On RHEL I installed libicu-devel, there is likely a package with a similar name for your distribution.

from polyglot.

xihajun avatar xihajun commented on June 5, 2024

This code below works on Google Colab

!pip install polyglot

!sudo apt-get install python-numpy libicu-dev

!pip install pyicu==2.3.1

!pip install morfessor

!pip install pycld2

from polyglot.

DerXter avatar DerXter commented on June 5, 2024

If you have a Mac M1 or higher, you may need a few more steps before those presented by @Mika15.
You can take a look at the full process on this StackOverflow response.

from polyglot.

AgaMiko avatar AgaMiko commented on June 5, 2024

For me installing those requirements helped:

pycld2>=0.20
six>=1.7.3
futures>=2.1.6
sphinxcontrib-napoleon>=0.2.8
mock>=1.0.1
sphinx-bootstrap-theme>=0.4.5
alabaster>=0.7.1```

from polyglot.

ronyarmon avatar ronyarmon commented on June 5, 2024

Coming back to polyglot after a while and reading here and in other source following some installation errors I propose the following for Ubuntu (22.04.2 LTS):
Ubuntu/Linux packages
$ sudo apt-get install libicu-de pkg-config
Python libraries
'pip install polyglot pycld2 PyICU morfessor`

from polyglot.

elephantasticio avatar elephantasticio commented on June 5, 2024

sudo apt-get install libicu-de pkg-config

small typo, should read:
sudo apt-get install libicu-dev pkg-config

from polyglot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.