New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'icu' #10

Closed
Fiedzia opened this Issue May 20, 2015 · 11 comments

Comments

Projects
None yet
@Fiedzia

Fiedzia commented May 20, 2015

python3.4:
pip install polyglot
from polyglot.text import Text, Word
---> 11 from icu import Locale
12 import pycld2 as cld2
13

ImportError: No module named 'icu'

Its not a module dependency nor is it mentioned in readme.

@aboSamoor

This comment has been minimized.

Show comment
Hide comment
@aboSamoor

aboSamoor May 20, 2015

Owner

Please follow the installation instrcutions mentioned in the documentation

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

Owner

aboSamoor commented May 20, 2015

Please follow the installation instrcutions mentioned in the documentation

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

@aboSamoor aboSamoor closed this Jun 2, 2015

@davidvartanian

This comment has been minimized.

Show comment
Hide comment
@davidvartanian

davidvartanian Sep 16, 2016

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.

davidvartanian commented Sep 16, 2016

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.

@peide

This comment has been minimized.

Show comment
Hide comment
@peide

peide Feb 14, 2017

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

peide commented Feb 14, 2017

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

@lukaskawerau

This comment has been minimized.

Show comment
Hide comment
@lukaskawerau

lukaskawerau Mar 31, 2017

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.

lukaskawerau commented Mar 31, 2017

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.

@mwozniczak

This comment has been minimized.

Show comment
Hide comment
@mwozniczak

mwozniczak Apr 13, 2017

@lukaskawerau try pip install pyicu

mwozniczak commented Apr 13, 2017

@lukaskawerau try pip install pyicu

@Mika15

This comment has been minimized.

Show comment
Hide comment
@Mika15

Mika15 Jun 29, 2017

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/

Mika15 commented Jun 29, 2017

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/

@davidvartanian

This comment has been minimized.

Show comment
Hide comment
@davidvartanian

davidvartanian Jun 29, 2017

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)

davidvartanian commented Jun 29, 2017

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)

@olmerg

This comment has been minimized.

Show comment
Hide comment
@olmerg

olmerg Nov 1, 2017

for me work
pip3 install pyicu
pip3 install pycld2

olmerg commented Nov 1, 2017

for me work
pip3 install pyicu
pip3 install pycld2

@sjlongland

This comment has been minimized.

Show comment
Hide comment
@sjlongland

sjlongland Feb 2, 2018

@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. :-)

sjlongland commented Feb 2, 2018

@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. :-)

@simonfullernuim

This comment has been minimized.

Show comment
Hide comment
@simonfullernuim

simonfullernuim Feb 27, 2018

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!

simonfullernuim commented Feb 27, 2018

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!

@tigerninjaman

This comment has been minimized.

Show comment
Hide comment
@tigerninjaman

tigerninjaman Aug 15, 2018

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.

tigerninjaman commented Aug 15, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment