0

I am new to installing OpenCV and I want to install python 3.6.7 and a compatible OpenCV version. I want to install it on 64bit windows 10 laptop. How can I do this?

user20707
  • 7
  • 5

1 Answers1

1

OK, if you are using python 3.6 - 64bits in windows OS (please be sure that it appear at the begin on your "python command line") first of all you have to go to this page: "https://www.lfd.uci.edu/~gohlke/pythonlibs/"

To install "opencv" library you first need "Numpy" library so let's download this right here: enter image description here

let's download opencv library too:

enter image description here

There is an easy way to install these 2 libraries on windows: 1.- Unzip these files (I recommend you 7zip to do it) and in the case of numpy we will have this files:

enter image description here

Let's copy "Numpy" and "numpy-1.15.4+mkl.data" files (I have 1.14.0 version, don't worry about that) to this path: "Python36\Lib\site-packages" (the path to Python36 depends of where you installed it).

import numpy on your python command line, if not appear any error, we have finished of installing numpy on windows 10.

In the case of opencv is a little different, when we unzip .whl file of opencv, we will have these files: enter image description here

let's enter to "opencv_python-3.4.1.data" --> "data" --> "Lib" --> "site-packages". and then copy all files inside "site-packages" directory to "Python36\Lib\site-packages" (the same directory where we paste numpy library)

as same as in the case of numpy, import opencv on your python command line using "import cv2", if not appear any error, we have finished of installing opencv on windows 10.

There is another way to install .whl libraries on windows using PIP but you have to be sure that your python can be called from cmd (there is an option when you installed python called "add to path" to make this posible) also you have to have a good internet conection to prevent any posible error when installing. There are many tutorials in stackoverflow explaining PIP method. Hope this helps!.

Diroallu
  • 824
  • 1
  • 11
  • 15
  • Thank you very much for the detailed explanation! Could you also please help me understand, why I need to install unofficial packages (from the link "https://www.lfd.uci.edu/~gohlke/pythonlibs/") such as wheel packages, when we can install it from official website? Also how to read the installation packages name? what does "numpy‑1.15.4+mkl‑cp36‑cp36m‑win_amd64.whl" mean? – user20707 Nov 19 '18 at 18:10
  • it's not really necessary, there are many ways of install python packages on windows, but it is the easiest way. The first number "1.15.4" is the version of numpy you download, Here is the answer of what means all the name of .whl files, just for not repeat answers. https://stackoverflow.com/questions/37023557/what-does-version-name-cp27-or-cp35-mean-in-python. – Diroallu Nov 21 '18 at 00:29