在使用docker运行model的时候,出现了如下的opencv错误。
File "/usr/local/services/miniconda3/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
ImportError: libSM.so.6: cannot open shared object file: No such file or directory
查找了资料之后,先按照这个博客进行了如下三板斧操作,并没有起到效果。
https://blog.csdn.net/qq_24798295/article/details/90240666
如果你使用的apt-get 就换成apt-get,系统差别导致。
之后在StackOverflow上找到 work的答案。
安装如下opencv包来替换,因为平常使用的版本移除了这些so库。
pip install opencv-python-headless
# also contrib, if needed
pip install opencv-contrib-python-headless