(newcvtest) $ ln -S /usr/local/Cellar/opencv/3.3.1_1/lib/python3.6/site-packages/ cv2.so (newcvtest) $ cd lib/python3.6/site-packages Ln -S /usr/local/Cellar/opencv/3.3.1_1/lib/python2.7/site-packages/cv2.so /usr/local/lib/python2.7/site-packages/cv2.soĪll you have to do is add the `cv2.so` to your virtualenv's site-packages. Ln -s /usr/local/Cellar/opencv/3.3.1_1/lib/python3.6/site-packages/ /usr/local/lib/python3.6/site-packages/cv2.so Type "help", "copyright", "credits" or "license" for more information. Add `cv2.so` to System Python (virtualenvs are next) # Get the Python 2.7 `cv2.so` File PathĬv2.so # this name might be different but. usr/local/Cellar/opencv/3.3.1_1/lib/python3.6/site-packagesĬv2.cpython-36m-darwin.so # this name might be different but.
#Opencv for mac os x install
You can install whatever version you want. In the meantime, let's get the `cv2.so` for each version of Python. I'll just need to add the correct `cv2.so` to your Python's site packages. If I want both versions to have OpenCV, I can. I have `Python 3.6` and `Python 2.7` installed on my system. Now we need to link it to our version of Python. Okay, so we have the OpenCV version we're going to use and where it's located. We're very close to getting the `cv2.so` we need.
![opencv for mac os x opencv for mac os x](https://i.ytimg.com/vi/1_0p9nA3yxM/hqdefault.jpg)
This is the OpenCV Version we want to use. You'll want the highest version number listed here, in my case it's `3.3.1_1`Īwesome. In my case, the numbers `3.3.0_3` and `3.3.1_1` are different versions of OpenCV. Now, let's go into the `opencv` directory. To see what's in the Brew Cellar, do this: Since we installed OpenCV with Homebrew, the package was should be listed in homebrew's Cellar (`/usr/local/Cellar/`) $ brew install opencv3 -with-contrib -with-python3
![opencv for mac os x opencv for mac os x](https://3.bp.blogspot.com/-qyA5yCSjMi8/VqupGfaxDvI/AAAAAAAAAHo/_bzwCfRLhXs/s1600/osx_opencv.png)
![opencv for mac os x opencv for mac os x](https://4.bp.blogspot.com/-INZ2CoPBREc/UgCZAuDLsAI/AAAAAAAAAL8/HtJsOmLjmnM/s1600/Screen+Shot+2013-08-06+at+11.53.30+AM.png)
Install OpenCV with Homebrew including Python3 Not using `pipenv`? Run `pip install opencv-contrib-python -upgrade` (cfestart) $ pipenv install opencv-contrib-python This guide is to help you get it installed on your Mac. OpenCV, aka Open Computer Vision, is an incredible library for doing everything from Face Recognition, Object Recognition, to edge detection, image manipulation, and much more.