问题描述
在我为非英语(Sinhala)语言做项目时,我需要对unicode中的单词进行排序.
As I'm doing a project for non-english (Sinhala) language I need to sort the words in unicode.
所以我在此问题并在conda环境中安装了PyICU,我已经安装了tensorflow和NLTK.
So I followed answer in this question and installed PyICU in a conda environment which I have already installed tensorflow and NLTK.
现在在使用 import icu
并执行代码时,我在python控制台中(在Pycharm中)
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
那是为什么? PyICU
是否有可能无法在conda环境中使用?
Why is that ? Is there any possibility that PyICU
can't be used in a conda environment ?
推荐答案
可以通过以下方式从conda-forge渠道安装pyicu:
Installing pyicu from the conda-forge channel can be achieved by adding conda-forge to your channels with:
conda config --add channels conda-forge
启用conda-forge频道后,可以使用以下方式安装pyicu:
Once the conda-forge channel has been enabled, pyicu can be installed with:
conda install pyicu
这解决了问题,它将安装具有依赖项的pyicu
this solves the problem and it will install pyicu with dependencies
这篇关于python 3中的PyICU错误:ImportError:libicui18n.so.58的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!