NLPIR python测试

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NLPIR python测试相关的知识,希望对你有一定的参考价值。

  • 编译安装python3.6

LINUX下载编译python_柳鲲鹏-CSDN博客

  • gighub下载NLPRI-python(执行出错)

https://github.com/NLPIR-team/nlpir-python

运行后提示错误:

  • 命令安装(执行出错)
sudo pip3 install nlpir-python

运行结果:

$ python3.6
Python 3.6.15 (default, Nov 22 2021, 16:15:30) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from nlpir.native import ICTCLAS
>>> test_str = "法国启蒙思想家孟德斯鸠曾说过:“一切有权力的人都容易滥用"
>>> ictclas = ICTCLAS()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/nlpir/native/nlpir_base.py", line 133, in __init__
    self.lib_nlpir, self.lib_path = self.load_library(platform.uname())
  File "/usr/local/lib/python3.6/site-packages/nlpir/native/nlpir_base.py", line 236, in load_library
    lib_nlpir = ctypes.cdll.LoadLibrary(lib)
  File "/usr/local/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/usr/local/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.6/site-packages/nlpir/lib/linux/x86/lib64/libNLPIR64.so: cannot open shared object file: No such file or directory
>>> 

以上是关于NLPIR python测试的主要内容,如果未能解决你的问题,请参考以下文章

NLPIR使用

常用python日期日志获取内容循环的代码片段

在 Python 多处理进程中运行较慢的 OpenCV 代码片段

python Python测试片段

python Cacher的测试片段

PyNLPIR python中文分词工具