When trying to import OpenCV, using import cv2
I get the following error:
/usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>() 7 8 # make IDE's (PyCharm) autocompletion happy ----> 9 from .cv2 import * 10 11 # wildcard import above does not import "private" variables like __version__ ImportError: libSM.so.6: cannot open shared object file: No such file or directory
Not sure how to fix this - trying to play around with Google's new Colaboratory tool. Notebook is here: https://drive.google.com/file/d/0B7-sJqBiyjCcRmFkMzl6cy1iN0k/view?usp=sharing
This fixed the problem by having it as the first two lines of the script:
!pip install opencv-python !apt update && apt install -y libsm6 libxext6 !apt-get install -y libxrender-dev
You need to add sudo . I did the following to get it installed :
sudo apt-get install libsm6 libxrender1 libfontconfig1
and then did that (optional! maybe you won't need it)
sudo python3 -m pip install opencv-contrib-python
FINALLY got it done !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With