Blog

How to Fix: OpenCV Darknet: ImportError libSM.so.6 cannot open shared object files

open-cv-python-issue-fix
OpenCV

How to Fix: OpenCV Darknet: ImportError libSM.so.6 cannot open shared object files

OpenCV (Open Source Computer Vision Library) is an open source machine learning software library. If you may get an error while you executing the python script in your Ubuntu operating system and the error looks like,

ImportError: libSM.so.6: cannot open shared object file: No such file or directory
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/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

You have missed some package dependencies in your Ubuntu 18.04 machine, install the following commands,

$ sudo apt-get update

$ sudo apt-get install -y libsm6 libxext6 libxrender-dev

$ sudo pip3 install opencv-python
Spread the love

Leave your thought here

Your email address will not be published. Required fields are marked *