当前位置:   article > 正文

【Anaconda安装包】如何在Ananconda环境下安装CV2(opencv)_conda 安装 opencv2

conda 安装 opencv2

python3 下的opencv:

环境:Anaconda == 3      python == 3.x

安装库: 

conda install -c menpo opencv

安装完之后更新源:

python -m pip install --upgrade pip

如果不行,可使用以下官网给到的方法:

 

Step 1: Install Anaconda (a python distribution)

Download and install Anaconda 64-bit version from https://www.anaconda.com/

It is advised to install Anaconda for Python 3.

Step 2 : Create Virtual Environment

Open the command prompt and execute the following command.

conda create --name opencv-env python=3.6

You should get an output as shown below:

Step 3 : Install OpenCV

3.1. Activate the environment

1

2

# See how the (opencv-env) appears before the prompt after this command.

activate opencv-env

3.2. Install OpenCV and other important packages

Continuing from the above prompt, execute the following commands

去清华镜像网站,搜索网址,下载对应的opencv库版本,:

  1. https://pypi.tuna.tsinghua.edu.cn/simple/opencv-python
  2. 下载:
  3. opencv_python-4.2.0.34-cp36-cp36m-win_amd64.whl
  4. 下载之后将xxx.whl包复制放在Anaconda3\envs\opencv-env\Lib\site-packages里面
  1. # 管理员prompt中,进入环境
  2. activate opencv-env
  3. cd C:\ProgramData\Anaconda3\envs\opencv-env\Lib\site-packages
  4. python -m pip install -U --force-reinstall pip
  5. pip install .\opencv_python-4.2.0.34-cp36-cp36m-win_amd64.whl
1pip install numpy scipy matplotlib scikit-learn jupyter
2pip install opencv-contrib-python
3pip install dlib

3.3. Test your installation

Open the python prompt on the command line by typing python on the command prompt

1

2

3

4

import cv2

cv2.__version__

import dlib

dlib.__version__

done !

 

https://www.learnopencv.com/install-opencv-3-and-dlib-on-windows-python-only/

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/631601
推荐阅读
相关标签
  

闽ICP备14008679号