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 "<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
>>> 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章