2015-05-19 112 views
1

我用自制軟件安裝了opencv。我收到以下錯誤 -Python:導入OpenCV時出錯

>>> import cv2 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/lib/libpng16.16.dylib 
    Referenced from: /usr/local/Cellar/opencv/2.4.11_1/lib/libopencv_highgui.2.4.dylib 
    Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 34.0.0 or later, but libpng16.16.dylib provides version 33.0.0 

如何解決此問題?

+0

可能重複? http://stackoverflow.com/questions/28124359/error-with-homebrew-opencv-libpng – GPPK

回答

0
Library not loaded: /usr/local/lib/libpng16.16.dylib 

^的libpng尚未加載由於某種原因

Referenced from: /usr/local/Cellar/opencv/2.4.11_1/lib/libopencv_highgui.2.4.dylib 

^highgui試圖加載它。

Reason: Incompatible library version 

^libopencv_highgui看起來需要至少版本34.0.0的libpng,而你的版本是33.0.0。我希望更新libpng應該可以做到。