Ask Your Question

Python PyCharm OpenCV

asked 2013-10-16 06:46:58 -0600

Theo gravatar image

Hi there,

I am having hard time setting up Python to work with OpenCV and PyCharm on my Mac. I searched a lot of pages on google but still haven't managed to configure it properly.

If anyone can help me by providing some instructions I'd be greatly thankful.

Thank you.

Regards, Theo

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-06 19:16:20 -0600

Strilanc gravatar image

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.

edit flag offensive delete link more

Question Tools


Asked: 2013-10-16 06:46:58 -0600

Seen: 7,082 times

Last updated: Sep 06 '14