Opencv-python imshow gives errors in mac

I installed opencv-python using pip install on mac os. Now cv2.imshow function giving the following error

OpenCV error: Unspecified error (function not implemented). Rebuild the library with support for Windows, GTK + 2.x or Carbon. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, -run cmake or configure the script) in cvShowImage

How can I solve this problem? Why doesn't it check opencv dependency on pip?

+6
source share
2 answers

Running imshow windows doesn't seem to work when installing opencv-python from pypi. Instead, uninstall it and follow the excellent instructions at http://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/

(Note that you no longer need to use the --HEAD tag since 3.2.0)

In short:

  • Make sure Xcode is installed
  • brew tap homebrew / science
  • brew install opencv3 --with-contrib
  • echo / usr / local / opt / opencv3 / lib / python2.7 / site-packages → (YOUR PYTHONPATH) /lib/python2.7/site-packages/opencv3.pth
+3
source

The fix that works best for me used mathplotlib .

Since you may have to uninstall all previous versions of OpenCV otherwise and reinstall from the source!

0
source

Source: https://habr.com/ru/post/1013053/


All Articles