Skip to content

Instantly share code, notes, and snippets.

@smichalowski
Created November 1, 2016 20:20
Show Gist options
  • Select an option

  • Save smichalowski/65674ba799d38c0b29da107cbd801879 to your computer and use it in GitHub Desktop.

Select an option

Save smichalowski/65674ba799d38c0b29da107cbd801879 to your computer and use it in GitHub Desktop.
opencv3 + macOS Sierra + python2.7 + macports
download opencv source code, cd into source dir.
```
mkdir build
cd build
cmake .. -DBUILD_opencv_videoio=OFF -DPYTHON_LIBRARY=/opt/local/lib/libpython2.7.dylib -DPYTHON2_PACKAGES_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages -DPYTHON2_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DCMAKE_INSTALL_PREFIX=/opt/local
make -j10
sudo make install
```
test your python
```
$ python
Python 2.7.12 (default, Sep 22 2016, 23:57:29)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>
```
great !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment