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 "<stdin>", line 1, in <module>
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
>>> 
Logo

更多推荐