python-opencv 坑 libopencv_imgproc.so.2.4: cannot open shared object file

1. libopencv_imgproc.so.2.4: cannot open shared object file 提示找不到

$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "", line 1, in 
ImportError: libopencv_imgproc.so.2.4: cannot open shared object file: No such file or directory
>>> 
>>> exit()

2.查看安装命令时:

Do you want to continue? [Y/n] y
dpkg: warning: files list file for package 'libopencv-core2.4v5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libopencv-imgproc2.4v5:amd64' missing; assuming package has no files currently installed

有dpkg的告警,以为无所谓,安装后出现1上面的无法使用.

3.解决

sudo aptitude reinstall libopencv-core2.4v5
sudo aptitude reinstall libopencv-imgproc2.4v5

再安装就ok了

 python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> 

你可能感兴趣的:(linux,python)