I installed opencv using macports but Python crashes when I try to use it:
Process finished with exit code 139
My PyCharm IDE indicates that cv2 is a failed module.
Failed modules Python 2.7.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python) cv2 Generation of skeletons for the modules above will be tried again when the modules are updated or a new version of generator is available
My MacPorts installation of opencv with python 2.7 bindings went smoothly so I'm not sure what could be causing this error. I am assuming that Python is able to import the library, but somehow that the library or its dependencies are failing.
On installation I made sure that numpy was installed first (see: How to install Python 2.7 bindings for OpenCV using MacPorts):
sudo port install opencv +python27
I also made soft links for the dylibs in /usr/local since MacPorts installs them in /opt/local. (see: How to install Python 2.7 bindings for OpenCV using MacPorts)