如果直接用下列方法安装:
conda install -c menpo opencv3=3.2.0
conda install -c https://conda.binstar.org/menpo opencv3等等方法
报错信息:
Fetching package metadata .............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to beinconflict:
- opencv -> python2.7*
- python3.6*
Use"conda info "to see the dependenciesforeach package.
或者是这个错误:
Traceback (most recent call last):
File "", line 1, in
ImportError: dlopen(/Applications/anaconda3/envs/data/lib/python3.5/site-packages/cv2.cpython-35m-darwin.so, 2): Library not loaded: @rpath/libopenblasp-r0.2.19.dylib
Referenced from: /Applications/anaconda3/envs/data/lib/libopencv_hdf.3.2.0.dylib
Reason: image not found
使用如下方法解决:
先用conda安装一个3.5.1的python环境(因为现在opencv3只支持到3.5.1的python环境)
$ conda create -yn opencvtest python=3.5.1
$ source activate opencvtest
然后在opencvtest的目录下安装opencv3
(opencvtest) bogon:~ xxxxxxx$ conda install -c menpo opencv3
最后查看一下是不是安装成功
(opencvtest) bogon:~ xxxxxxx$ conda list
opencv3 3.1.0 py27_0 https://conda.binstar.org/menpo
你已经成功安装好opencv3了,快去测试一下是否运行成功
import cv2
print(cv2.__version__)
打印结果
3.1.0