1.报错
Traceback (most recent call last):
File "data_generator.py", line 24, in <module>
import cv2
File "/usr/local/lib/python3.5/dist-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
报错原因为缺少依赖库
2.解决方法
2.1. 安装apt-file
apt-get update
apt-get install apt-file
apt-file update
2.2. 寻找依赖库,根据提示安装
apt-file search libSM.so.6
apt-get install libsm6
2.3. apt-file命令
搜索缺少文件并列出依赖库
apt-file seach [filename]
列出包中的文件
# 命令格式
$ apt-file list [package name]
# Demo
$ apt-file list python-opencv
参考
https://blog.csdn.net/yjk13703623757/article/details/93673927