python环境安装opencv时候,遇到的问题整理:
通常我们使用pip install opencv-python
进行安装,安装顺利,但我们在import cv2
导入时候就会抛出错误,主要是缺少依赖;
① libgthread-2.0.so.0: cannot open shared object file: No such file or directory
解决:apt-get install libglib2.0-0
或先更新后安装apt-get update && apt-get install -y libglib2.0-0
(ubuntu)
② libSM.so.6: cannot open shared object file: No such file or directory
解决:apt-get install -y python-qt4
③ libGL.so.1: cannot open shared object file: No such file or directory
解决:apt-get install libgl1-mesa-dev