PyICU in python 3 error : ImportError: libicui18n.so.58

落爺英雄遲暮 提交于 2021-02-05 09:32:29

问题


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 ?


回答1:


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




回答2:


You need to install libicu. On centos, just run

yum install libicu


来源:https://stackoverflow.com/questions/48365494/pyicu-in-python-3-error-importerror-libicui18n-so-58

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!