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

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

原文链接:https://blog.csdn.net/liuyingying0418/article/details/84580254

在docker虚拟机下安装了opencv以后,在使用的时候出现以下报错,

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

原因是缺少共享文件库,有两种解决办法:
https://www.cnblogs.com/richerdyoung/p/8458910.html
https://stackoverflow.com/questions/32389599/anaconda-importerror-libsm-so-6-cannot-open-shared-object-file-no-such-file-o
试了下,这两种方法均不适合自己情况,遂采用第三种办法。
参考 https://blog.csdn.net/quincuntial/article/details/79047050
先安装apt-file。

# Install
$ apt-get update
$ apt-get install apt-file
# Update apt-file
$ apt-file update

然后寻找该依赖库:

apt-file search libSM.so.6

根据提示安装合适的依赖库:

apt-get install libsm6

即可解决问题。

你可能感兴趣的:(Tensorflow)