0

As I'm doing a project for non-english (Sinhala) language I need to sort the words in unicode.

So I followed answer in this question and installed PyICU in a conda environment which I have already installed tensorflow and NLTK.

Now in python console (in Pycharm) when use import icu and execute the code I'm getting this error.

Traceback (most recent call last):
  File "/home/pankaja/PycharmProjects/teamspark/testing/sinhalasort.py", line 1, in <module>
    import icu
  File "/home/pankaja/anaconda3/envs/tensorflow/lib/python3.5/site-packages/icu/__init__.py", line 37, in <module>
    from _icu import *
ImportError: libicui18n.so.58: cannot open shared object file: No such file or directory

Why is that ? Is there any possibility that PyICU can't be used in a conda environment ?

Thidasa Pankaja
  • 930
  • 8
  • 25
  • 44
  • Have you installed the libicu? from the [project page](https://pypi.python.org/pypi/PyICU/) `Before building PyICU the ICU libraries must be built and installed` – gipi Jan 22 '18 at 16:41
  • How can I check for ICU library location ? – Siddharth Das May 07 '18 at 14:50
  • .so means Linux library - mostly created in C/C++ - so you may have to install it from Linux repository. Or you have to get source code in C/C++ and compile it. – furas Jul 04 '18 at 12:48
  • @SiddharthDas Linux has command `find` to search files (using many useful optionos). There is also `locate` which use database with names of all files - so it can works faster, but you need to updated database (command `updatedb`) and it doesn't have options. – furas Jul 04 '18 at 12:52

2 Answers2

2

Installing pyicu from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge

Once the conda-forge channel has been enabled, pyicu can be installed with:

conda install pyicu

this solves the problem and it will install pyicu with dependencies

Harish
  • 157
  • 2
  • 11
0

You need to install libicu. On centos, just run

yum install libicu
Zoe
  • 27,060
  • 21
  • 118
  • 148
charlie
  • 27
  • 2
  • 7