Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda

It took a long time to find out ...

Surprisingly, it took a lot of time to find out how to install OpenCV 3.4. As a result, I downloaded and installed the Wheel package from an unofficial location. If you are interested in the process, please read the last one. I changed the title because I confirmed that it can be installed in the same way with OpenCV 4.0 and Python 3.7 (2018/12/25) </ sup> Since OpenCV3.4 came out, the part that was OpenCV3.3 was renewed (2018/3/8) </ sup>

The following is an article I tried after installation.

-[Explanation for beginners] openCV face detection mechanism and practice (detectMultiScale) -Specify parameters in openCV face detection to quickly improve detection accuracy -Face detection from multiple image files with openCV and cut out and saved

* OpenCV3.4 was not on Anaconda Cloud as of 3/4/2018 </ sup>

environment

type version
OS Windows10 Professional 64bit
Anaconda3 Anaconda 5.0.1
Python Python3.6(Anaconda virtual environment)

Installation procedure

0. Premise

It is a prerequisite before installation. Anaconda3 5.0.1 is already installed in my environment (Windows 10 64bit). Please refer to the separate article "Installing TensorFlow on Windows was easy even for Python beginners" for the installation procedure of Anaconda.

1. Wheel package download

Click "opencv_python-3.4.1-cp36-cp36m-win_amd64.whl" from link to download the Wheel package. I will. * Please select the version you want to use as appropriate </ sup> 20.DownloadOpenCV.JPG

2. Create Anaconda virtual environment

Launch Anaconda Navigator from the Windows menu. Similar to Apache Ambari. 20.Anaconda_Navigator02.JPG

Enter "openCV" as the virtual environment name and select Python 3.6. 20.CreateVirtualEnv01.JPG

3. openCV installation

Open a terminal from the virtual environment. 30.InstallOpenCV01.JPG

Change the directory to the location where you downloaded the Wheel package in the steps of "1. Wheel Package Download".

cd C:\Users\yohei.fukuhara\Downloads

Install with pip.

pip install opencv_python‑3.4.1‑cp36‑cp36m‑win_amd64.whl

The installation was successful without any problems.

4. Install numpy and matplotlib

If you don't have numpy, you will get an error, so install it. I haven't investigated it in detail, but there was information that matplotlib is similar, so I will install it for the time being.

conda install numpy
pip install matplotlib

Installation is successful.

5. Installation confirmation

Confirm the installation of openCV2. Start python.

python

Import the openCV library and view the version.

import cv2
print(cv2.__version__)

There seems to be no problem!

Investigation process

Please see only those who are interested. This is what I checked when it was OpenCV 3.2. </ sup>

Not in Anaconda Cloud

~~ First, I searched for Anaconda Cloud, but there is no openCV3.3 for Windows ... 3.2 was in conda-forge.

After all reliable Stackoverflow

When I searched on Stackoverflow, there was an answer!["Installing opencv on Windows 10 with python 3.6 and anaconda 3.6"](https://stackoverflow.com/questions/42994813/installing-opencv-on-windows-10-with-python-3-6-and-anaconda- 3-6) and that's exactly what it is: grin:

For the time being, check the download source site

However, the source of dropping the Wheel package I felt suspicious, so check it just in case. It seems to be the site of Professor Christopher of the University of California, Irvine. There is also a name on the official website, so it should be okay ... Others seem to be using it for the same purpose as introduced in the article "Installing OpenCV 3.2 and Python 3.6 on Windows 10". is.

Recommended Posts

Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
[Python] How to install OpenCV on Anaconda [Windows]
Build and install OpenCV on Windows
Install Anaconda on Windows 10
Install python on windows
Install and run Python3.5 + NumPy + SciPy on Windows 10
Install ZIP version Python and pip on Windows 10
Install watchdog on Windows + Python 3.3
Install Python and Flask (Windows 10)
Install Python environment with Anaconda
Install OpenCV on Ubuntu + python
[Python] [Chainer] [Windows] Install Chainer on Windows
Install selenium on Mac and try it with python
[Windows] [Python3] Install python3 and Jupyter Notebook (formerly ipython notebook) on Windows
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Install django on python + anaconda and start the server
Shining life with Python and OpenCV
Python 3.6 on Windows ... and to Xamarin.
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
Anaconda python environment construction on Windows 10
Install OpenCV and Chainer on Ubuntu
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Install Pytorch on Blender 2.90 python on Windows
Install Python 3.7 Anaconda on MAC, but Python 2
Integrate Modelica and Python on Windows
Use Tensorflow 2.1.0 with Anaconda on Windows 10!
Install Python development environment on Windows 10
Install PyStan on Windows without Anaconda
Getting started with Python 3.8 on Windows
[Python Windows] pip install with Python version
Install easy_install and pip on windows
Install python and Visual Studio Code on windows10 (April 2020 version)
Python on Windows
Notes for using OpenCV on Windows10 Python 3.8.3.
Install opencv on Mac using Anaconda Navigator
Run servo with Python on ESP32 (Windows)
Build Python3 and OpenCV environment on Ubuntu 18.04
[Kivy] How to install Kivy on Windows [Python]
Install wsl2 and master linux on windows
Capturing images with Pupil, python and OpenCV
A memo with Python2.7 and Python3 on CentOS
scipy stumbles with pip install on python 2.7.8
Build Python environment with Anaconda on Mac
Run py.test on Windows Anaconda and MinGW
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
How to install OpenCV on Cloud9 and run it in Python
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a Python environment on your Mac with Anaconda and PyCharm
Quickly install OpenCV 2.4 (+ python) on OS X and try the sample
Install lp_solve on Mac OS X and call it with python.
Hello World and face detection with OpenCV 4.3 + Python
Install python on WSL
Put Cabocha 0.68 on Windows and try to analyze the dependency with Python
Install Python3, numpy, pandas, matplotlib, etc. on Windows
Install Python on Pidora.
Install Scrapy on python3
How to install OpenCV on Jetson Nano Python
Binarization with OpenCV / Python