python 在Python 3.5上的Mac OS Sierra上安装OpenCV

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 在Python 3.5上的Mac OS Sierra上安装OpenCV相关的知识,希望对你有一定的参考价值。


# 1. Download and install the latest Anaconda distribution from  https://www.continuum.io/downloads#macos

# 2. Create a new Python environment. Make sure you choose python 3.5 as your python version for the virtual environment:

conda create -n myenv python=3.5

# 3. Activate the new environment using:

source activate myenv

# 4. OpenCV depends on NumPy, which can be installed with:

conda install numpy

# 5.Install the anaconda-client command utility to search for the OpenCV binary in Conda:

conda install anaconda-client

# 6. Search for OpenCV 3:

anaconda search -t conda opencv3

# 7. You will see a few options but choose a package that supports osx-64. For example choose https://conda.anaconda.org/menpo which support osx-64.

conda install --channel https://conda.anaconda.org/menpo opencv3

# 8. Test Open CV with below code. It should return the installed Open CV version.

import cv2
print("OpenCV version:")
print(cv2.__version__)

以上是关于python 在Python 3.5上的Mac OS Sierra上安装OpenCV的主要内容,如果未能解决你的问题,请参考以下文章

Mac下更改python版本为3.5

Mac 升级python2.7 到 3.5

当我在 mac 上安装了 python 3.5 时,终端运行 python 2.7。

将 linux 2.7 上的 python 更新到 3.5

在蓝牙环境中的Windows上的Python 3.5。请求的地址在其上下文中无效

python 3.5(Anaconda 包)上的 Pymssql 问题:Dll 加载失败:找不到特定模块