linux ImportError: libSM.so.6: cannot open shared object file: No such file or directory

环境 centos7 python3.6

在 import cv2的时候报错,如下

Traceback (most recent call last):
File "parse.py", line 5, in 
  import cv2
File "/home/ai/venv/tf/lib/python3.6/site-packages/cv2/__init__.py", line 3, in 
  from .cv2 import *
ImportError: libSM.so.6: cannot open shared object file: No such file or directory

原因是:缺少共享库

用一下命令查看查看缺少的共享库:   

yum whatprovides libSM.so.6

linux ImportError: libSM.so.6: cannot open shared object file: No such file or directory_第1张图片

linux ImportError: libSM.so.6: cannot open shared object file: No such file or directory_第2张图片

可以看到缺少的是这个包:libSM-1.2.2-2.el7.i686,接下来可以使用这个命令进行安装:

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

 

 

你可能感兴趣的:(Python,OpenCV,Linux)