Installing OpenCV 3.0.0 with python 2.7.9 into a virtualenv on Mac OSX without homebrew
Its pretty easy to install openCV to your machine or vagrant box but its not as easy to install onto your virtualenv without brew. I enjoy brew, it has helped me tremendously and I’ve nothing against it. But I also like to have control over what I compile and where I place it.
Tested on :
- Yosemite
- El Capitan
Setup
-
Install pip, virtualenv and activate the current environment as that new env;
$ sudo easy_install pip $ pip install virtualenv $ virtualenv env $ source env/bin/activate
throughout this post dont deactivate your virtual env
Install numpy dependency
(env)$ pip install numpy
-
Download opencv here and unzip it. For this tutorial this is v3.0.0.
...(env)$ cd /path/to/your/opencv-3.0.0 (env)$ mkdir release (env)$ cd release (env)$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$VIRTUAL_ENV -D PYTHON2_PACKAGES_PATH=$VIRTUAL_ENV/lib/python2.7/site-packages -D