Python importError when importing cv2

I installed opencv3 using brew, but ran importErrorinto runningimport 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 anyone help?

+4
source share
1 answer

The following issues have been resolved.

brew uninstall --force brew-cask
brew uninstall --force opencv
brew doctor
brew tap homebrew/science
brew install opencv
+7
source

All Articles