Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to install OpenCV in Python?

1 Answer

0 votes
by (108k points)

Before installing OpenCV in Python, you need to install the following packages in the default locations:

  • Python 2.7.x
  • NumPy
  • Matplotlib 

After successfully installing the above packages, now, you have to download the latest version of OpenCV from this link.

After downloading OpenCV, now, you can install it in your system. For that, click on the .exe file, and it will extract all the files into your system.

Now, you just need to browse to the opencv/build/Python/2.7 folder and simply copy the syntax cv2.pyd and paste it to C:/Python27/lib/site-packages.

Finally, for checking if OpenCV is installed properly, you can go to Python IDLE and execute the following codes in the Python terminal:

>>> import cv2

>>> print cv2.__version__

If you're not getting any errors, then it means that you have successfully installed OpenCV.

If you are looking for an online course to learn Python, I recommend this Python Training program by Intellipaat.

Related questions

0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Feb 8, 2021 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 21, 2021 in Python by laddulakshana (16.4k points)

Browse Categories

...