pip install opencv-python报错

在import cv2之后报了错误如下:

File "", line 1, in 
  File "/root/anaconda2/lib/python2.7/site-packages/cv2/__init__.py", line 3, in 
    from .cv2 import *
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

解决:

apt-get install libglib2.0-0

之后import cv2,还是报错了!

File "", line 1, in 
  File "/root/anaconda2/lib/python2.7/site-packages/cv2/__init__.py", line 3, in 
    from .cv2 import *
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory

解决方法:

apt-get install libxrender1

 

你可能感兴趣的:(linux下各种异常解决)