conda install -c conda-forge opencv
import cv2
error:
$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/httbser/anaconda3/lib/python3.6/site-packages/cv2.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /Users/httbser/anaconda3/lib/libopencv_freetype.3.4.dylib
Reason: Incompatible library version: libopencv_freetype.3.4.dylib requires version 22.0.0 or later, but libfreetype.6.dylib provides version 21.0.0
Solution:
conda install openblas=0.2.19
$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>