Skip to content

Instantly share code, notes, and snippets.

@ranveeraggarwal
Created February 2, 2016 19:17
Show Gist options
  • Save ranveeraggarwal/f1499a586dabafb63392 to your computer and use it in GitHub Desktop.
Save ranveeraggarwal/f1499a586dabafb63392 to your computer and use it in GitHub Desktop.
brew install python3
pip3 install numpy
brew install cmake
git clone --depth=1 https://github.com/Itseez/opencv.git
cd opencv
mkdir build
cd build
# note: in the next line, adjust paths to point to the correct python version
cmake -DBUILD_opencv_python3=YES -DBUILD_opencv_python2=NO -DINSTALL_PYTHON_EXAMPLES=YES -DPYTHON3_EXECUTABLE=/usr/local/bin/python3 -DPYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m/ -DPYTHON3_LIBRARY=/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib -DPYTHON3_NUMPY_INCLUDE_DIRS=/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/ -DPYTHON3_PACKAGES_PATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/ ..
make -j8
make install
python3 -c "import cv2; print(cv2.__version__)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment