Ask Your Question

Revision history [back]

I ran into a similar issue. Here's the things I had to do to get from the bad state I was in to a working state:

  • Homebrew was conflicting with MacPorts, so I had to uninstall MacPorts.
  • "brew install opencv" was failing by saying it couldn't write to /usr/local/bin so I had to run "sudo chown -R $USER /usr/local/bin".
  • Repeat above problem, but with /usr/local/include. Apply "sudo chown -R $USER /usr/local/include" liberally. Once those two folders were writable, brew install opencv succeeded.
  • PyCharm was using the wrong python environment. I had to go to PyCharm -> preferences -> Project Interpreter and select Python 2.7.8 (the latest one I had installed that wasn't python 3).

After that, I was able to import cv2 in my project and do opencv things.