zoukankan      html  css  js  c++  java
  • ImportError: libSM.so.6: cannot open shared object file: No such file or directory

    在centos中使用opencv-python。在进行导入的时候报出如下错误

    >>> import cv2
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/python3/lib/python3.6/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
    ImportError: libSM.so.6: cannot open shared object file: No such file or directory

    主要原因时系统缺少libSM.so.6库文件。
    可以使用如下命令查找包含此库的文件

    yum whatprovides libSM.so.6


    显示如下

    Loaded plugins: fastestmirror, ovl
    Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
    Determining fastest mirrors
    * base: mirrors.bfsu.edu.cn
    * epel: repo.ugm.ac.id
    * extras: mirrors.bfsu.edu.cn
    * updates: mirror.bit.edu.cn
    libSM-1.2.2-2.el7.i686 : X.Org X11 SM runtime library
    Repo : base
    Matched from:
    Provides : libSM.so.6

    说明只要安装libSM-1.2.2-2.el7.i686文件就行
    如果系统时64位需要把i686改成x86_64
    如下

    yum install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false

    如果缺少其他库一样方法安装就行。

  • 相关阅读:
    Jquery停止动画
    Jquery自定义动画与动画队列
    关系型数据库的常用概念
    三大范式审核
    数据库设计基本步骤
    'NoneType' object is not iterable
    三行神奇的代码
    url的解码方式
    [转]获取当前执行主脚本的方法
    非黑即白--谷歌OCR光学字符识别
  • 原文地址:https://www.cnblogs.com/apexchu/p/14632380.html
Copyright © 2011-2022 走看看