1、系统环境
[root@wrx tmp]# uname -sir Linux 2.6.32-696.el6.x86_64 x86_64 [root@wrx tmp]#
2、异常
[root@wrx tmp]# python3 Python 3.5.4 (default, Feb 5 2018, 19:21:23) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/site-packages/cv2/__init__.py", line 4, in <module> from .cv2 import * ImportError: libSM.so.6: cannot open shared object file: No such file or directory
3、解决方法
报错问题是缺少libSM.so.6 #查找libSM.so.6属于哪个安装包 [root@wrx tmp]# yum provides libSM.so.6 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.ustc.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com * webtatic: us-east.repo.webtatic.com libSM-1.2.1-2.el6.i686 : X.Org X11 SM runtime library Repo : base Matched from: Other : libSM.so.6 #安装 [root@wrx tmp]# yum install libSM -y