I have installed opencv3 using brew, but am facing importError
while executing import cv2
>>> 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/opt/libpng/lib/libpng16.16.dylib
Referenced from: /usr/local/Cellar/opencv/2.4.12_2/lib/libopencv_highgui.2.4.dylib
Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 37.0.0 or later, but libpng16.16.dylib provides version 35.0.0
Can someone help ?
答案 0 :(得分:7)
以下解决了这个问题。
brew uninstall --force brew-cask
brew uninstall --force opencv
brew doctor
brew tap homebrew/science
brew install opencv