Skip to content

Instantly share code, notes, and snippets.

@Gunnvant
Last active April 11, 2021 12:07
Show Gist options
  • Save Gunnvant/bed6ed28de512abfa1fc6d730a2ee406 to your computer and use it in GitHub Desktop.
Save Gunnvant/bed6ed28de512abfa1fc6d730a2ee406 to your computer and use it in GitHub Desktop.
Installing opencv3 in windows

Installing opencv3 in a windows machine

Opencv3 can be easily installed in windows by following the steps discussed below

Pre-requisites

  • Windows version 10
  • Anaconda distribution

Installation

Opencv3 in anaconda is supported by python 3.5+. You can use the following steps to install opencv in windows

  • You need to start anaconda prompt in admninistrator mode (just search for anaconda prompt in search bar then left click and select "Run as administrator" option).
  • Now install opencv3 by typing the following lines of code in the anaconda prompt:
conda install -c conda-forge opencv 
  • After the installation is done, check if everything is working fine by starting an ipython shell by typing the following in the anaconda prompt
ipython
  • Once the shell starts type:
import cv2
import numpy
import pandas
import matplotlib

If this code runs without error, then congratulations you have successfully installed opencv3 on a windows machine. If you face any issues please comment below. I will be actively maintaining this gist

@anchitjp
Copy link

Hello Gunnvant,

I have installed opencv, however I am not able to load the library.
Please suggest to rectify.

Annotation 2020-07-21 204833

@Gunnvant
Copy link
Author

Hello Gunnvant,

I have installed opencv, however I am not able to load the library.
Please suggest to rectify.

Annotation 2020-07-21 204833

cv2 needs a c/c++ compiler. Check what versions of windows c compiler you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment